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