X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fpool.c;h=8b7c372518b232f1f28cf2bda6b2d43bf5264067;hb=aec2d301675f4ecaac35cc2c52021fdd9d5d9f33;hp=6143c68af0b67c5f2f87301b08e90773e8b31000;hpb=b7e3d06a00ca5c95df8202678da7e3b11037c6be;p=libucw.git diff --git a/lib/pool.c b/lib/pool.c index 6143c68a..8b7c3725 100644 --- a/lib/pool.c +++ b/lib/pool.c @@ -2,12 +2,16 @@ * Sherlock Library -- Memory Pools (One-Time Allocation) * * (c) 1997--2001 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ #include "lib/lib.h" #include "lib/pools.h" #include +#include struct memchunk { struct memchunk *next; @@ -97,3 +101,11 @@ mp_alloc(struct mempool *p, uns s) return c->data; } } + +void * +mp_alloc_zero(struct mempool *p, uns s) +{ + void *x = mp_alloc(p, s); + bzero(x, s); + return x; +}