2 * Sherlock Library -- Memory Pools
4 * (c) 1997 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
8 #define POOL_ALIGN CPU_STRUCT_ALIGN
12 struct memchunk *chunks;
14 uns chunk_size, threshold;
17 struct mempool *new_pool(uns);
18 void free_pool(struct mempool *);
19 void *pool_alloc(struct mempool *, uns);
21 extern inline void *fast_alloc(struct mempool *p, uns l)
23 void *f = (void *) (((uns) p->free + POOL_ALIGN - 1) & ~(POOL_ALIGN - 1));
26 return pool_alloc(p, l);
31 extern inline void *fast_alloc_noalign(struct mempool *p, uns l)
36 return pool_alloc(p, l);