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