2 .TH alloc 3 "8 May 1999" "mLib"
7 alloc \- mLib low-level memory allocation
10 .B "#include <mLib/alloc.h>"
12 .BI "void *xmalloc(size_t " sz );
13 .BI "void *xrealloc(void *" p ", size_t " sz );
14 .BI "char *xstrdup(const char *" s );
17 These functions allocate and return blocks of memory. If insufficient
18 memory is available, an
26 functions are veneers over the standard
34 bytes and returns a pointer to the base of the block;
38 to a block of memory, and returns the address of a new block of size
40 bytes with the same contents as the original one (either truncated, if
41 the new block is smaller, or padded with rubbish at the end if bigger).
45 function allocates and returns a block of memory containing a copy of
46 the null-terminated string
48 The block is just large enough for the string and its null terminator.
50 The memory blocks allocated by these functions can be released by
60 functions return pointers to the blocks they allocated. They do not
61 return if a block couldn't be allocated; instead, the exception
71 Mark Wooding, <mdw@nsict.org>