X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/0fd574c3198e0a08b7b27972f7931d0c7deb19fb..d45be1af09ff22a4778172ee2e55745c2c3229ed:/alloc.h diff --git a/alloc.h b/alloc.h index edf555a..e06fb00 100644 --- a/alloc.h +++ b/alloc.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: alloc.h,v 1.5 2000/06/17 10:35:51 mdw Exp $ + * $Id: alloc.h,v 1.7 2004/04/08 01:36:11 mdw Exp $ * * Memory allocation functions * @@ -27,26 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: alloc.h,v $ - * Revision 1.5 2000/06/17 10:35:51 mdw - * Major overhaul for arena support. - * - * Revision 1.4 1999/12/10 23:42:04 mdw - * Change header file guard names. - * - * Revision 1.3 1999/05/06 19:51:35 mdw - * Reformatted the LGPL notice a little bit. - * - * Revision 1.2 1999/05/05 18:50:31 mdw - * Change licensing conditions to LGPL. - * - * Revision 1.1.1.1 1998/06/17 23:44:42 mdw - * Initial version of mLib - * - */ - #ifndef MLIB_ALLOC_H #define MLIB_ALLOC_H @@ -96,6 +76,7 @@ extern char *x_strdup(arena */*a*/, const char */*s*/); * Arguments: @arena *a@ = pointer to underlying arena * @void *p@ = pointer to a block of memory * @size_t sz@ = new size desired for the block + * @size_t osz@ = size of the old block * * Returns: Pointer to the resized memory block (which is almost * certainly not in the same place any more). @@ -104,7 +85,8 @@ extern char *x_strdup(arena */*a*/, const char */*s*/); * exception @EXC_NOMEM@ is thrown. */ -extern void *x_realloc(arena */*a*/, void */*p*/, size_t /*sz*/); +extern void *x_realloc(arena */*a*/, void */*p*/, + size_t /*sz*/, size_t /*osz*/); /* --- @x_free@ --- * * @@ -152,6 +134,7 @@ extern char *xstrdup(const char */*s*/); * * Arguments: @void *p@ = pointer to a block of memory * @size_t sz@ = new size desired for the block + * @size_t osz@ = size of the old block * * Returns: Pointer to the resized memory block (which is almost * certainly not in the same place any more). @@ -160,8 +143,8 @@ extern char *xstrdup(const char */*s*/); * exception @EXC_NOMEM@ is thrown. */ -extern void *xrealloc(void */*p*/, size_t /*sz*/); -#define xrealloc(p, sz) x_realloc(arena_global, (p), (sz)) +extern void *xrealloc(void */*p*/, size_t /*sz*/, size_t /*osz*/); +#define xrealloc(p, sz, osz) x_realloc(arena_global, (p), (sz), (osz)) /* --- @xfree@ --- * *