3 binalloc, bingrow, binfree \- grouped memory allocation
14 typedef struct Bin Bin;
17 void *binalloc(Bin **bp, ulong size, int clr);
20 void *bingrow(Bin **bp, void *op, ulong osize,
26 void binfree(Bin **bp);
28 These routines provide simple grouped memory allocation and deallocation.
35 All items in a bin may be freed with one call to
37 there is no way to free a single item.
40 returns a pointer to a new block of at least
43 The block is suitably aligned for storage of any type of object.
44 No two active pointers from
46 will have the same value.
49 returns a valid pointer rather than null.
52 is non-zero, the allocated memory is set to 0;
53 otherwise, the contents are undefined.
56 is used to extend the size of a block of memory returned by
59 must point to the same bin group used to allocate the original block,
62 must be the last size used to allocate or grow the block.
63 A pointer to a block of at least
65 bytes is returned, with the same contents in the first
70 is non-zero, the remaining bytes are set to 0,
71 and are undefined otherwise.
78 are ignored, and the result is the same as calling
84 allocate large chunks of memory using
86 and return pieces of these chunks.
92 .B /usr/local/plan9/src/libbin
99 return 0 if there is no available memory.