2 * Sherlock Library -- Memory Pools
4 * (c) 1997--1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
8 #define POOL_ALIGN CPU_STRUCT_ALIGN
13 struct memchunk *first, *current, **plast;
14 struct memchunk *first_large;
15 uns chunk_size, threshold;
18 struct mempool *new_pool(uns);
19 void free_pool(struct mempool *);
20 void flush_pool(struct mempool *);
21 void *pool_alloc(struct mempool *, uns);
23 static inline void *fast_alloc(struct mempool *p, uns l)
25 byte *f = (void *) (((uns) p->free + POOL_ALIGN - 1) & ~(POOL_ALIGN - 1));
28 return pool_alloc(p, l);
33 static inline void *fast_alloc_noalign(struct mempool *p, uns l)
38 return pool_alloc(p, l);