.TH "memalloc.h" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME memalloc.h \- .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct cc_memalloc \fBcc_memalloc\fP" .br .ti -1c .RI "typedef int \fBcc_memalloc_strategy_cb\fP (const int numunits_allocated)" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "cc_memalloc * \fBcc_memalloc_construct\fP (const unsigned int unitsize)" .br .ti -1c .RI "void \fBcc_memalloc_destruct\fP (cc_memalloc *allocator)" .br .ti -1c .RI "void * \fBcc_memalloc_allocate\fP (cc_memalloc *allocator)" .br .ti -1c .RI "void \fBcc_memalloc_deallocate\fP (cc_memalloc *allocator, void *ptr)" .br .ti -1c .RI "void \fBcc_memalloc_clear\fP (cc_memalloc *allocator)" .br .ti -1c .RI "void \fBcc_memalloc_set_strategy\fP (cc_memalloc *allocator, cc_memalloc_strategy_cb *cb)" .br .in -1c .SH "Detailed Description" .PP .SH "Function Documentation" .PP .SS "cc_memalloc* cc_memalloc_construct (const unsigned intunitsize)" Construct a memory allocator\&. Each allocated unit will be \fIunitsize\fP bytes\&. .SS "void cc_memalloc_destruct (cc_memalloc *allocator)" Destruct \fIallocator\fP, freeing all memory used\&. .SS "void* cc_memalloc_allocate (cc_memalloc *allocator)" Allocate a memory unit from \fIallocator\fP\&. .SS "void cc_memalloc_deallocate (cc_memalloc *allocator, void *ptr)" Deallocate a memory unit\&. \fIptr\fP must have been allocated using \fBcc_memalloc_allocate()\fP, of course\&. .SS "void cc_memalloc_clear (cc_memalloc *allocator)" Free all memory allocated by \fIallocator\fP\&. .SS "void cc_memalloc_set_strategy (cc_memalloc *allocator, cc_memalloc_strategy_cb *cb)" Sets the allocator strategy callback\&. should be a function that returns the number of units to allocated in a block, based on the number of units currently allocated\&. .PP The default strategy is to just return the number of units allocated (which will successively double the internal memory chunk sizes), unless the number of units allocated is less than 64, then 64 is returned\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.