2 .TH alloc 3 "8 May 1999" "Straylight/Edgeware" "mLib utilities library"
12 alloc \- mLib low-level memory allocation
15 .B "#include <mLib/alloc.h>"
17 .BI "void *x_alloc(arena *" a ", size_t " sz );
18 .BI "char *x_strdup(arena *" a ", const char *" s );
19 .BI "void *x_realloc(arena *" a ", void *" p ", size_t " sz ", size_t " osz );
20 .BI "void x_free(arena *" a ", void *" p );
22 .BI "void *xmalloc(size_t " sz );
23 .BI "void *xrealloc(void *" p ", size_t " sz ", size_t " osz );
24 .BI "char *xstrdup(const char *" s );
25 .BI "void xfree(void *" p );
28 These functions allocate and return blocks of memory. If insufficient
29 memory is available, an
39 work with a given arena (see
42 allocates a block of a given size;
44 resizes an allocated block;
46 allocates a copy of a null-terminated string; and
50 is supplied for orthogonality's sake: it's equivalent to calling the
60 macros are provided as a convenient interface to failsafe memory
61 allocation from the current arena
68 Mark Wooding, <mdw@distorted.org.uk>