Archived
1
0
Fork 0

Changed the documentation structure

This commit is contained in:
Fredric N 2011-01-22 14:37:14 +01:00 committed by Henrik Hautakoski
parent 8be6c69e97
commit 3c0e4e6470
13 changed files with 34 additions and 8 deletions

View file

@ -1,42 +0,0 @@
xalloc - safe memory allocation
-------------------------------
This module implements malloc and friends + some extensions.
If `__DEBUG__` symbol is defined. The functions will provide extended
debug logic and kills the program (passing 0 as size to malloc for example).
The funtions will at all times kill the program if memory can't be allocated for
some reason, this makes the need for client-code to check for `NULL` pointers returned
by these functions redundant.
Functions
~~~~~~~~~
`xmalloc()`::
Just like malloc, this function allocates a block of memory of 'size' bytes. +
If compiled with the `__DEBUG__` symbol, the function will not allow zero size
`xmallocz()`::
Exactly like xmalloc but will initialize the block with zero's.
`xrealloc()`::
Reallocates a previous allocated block of memory to 'size' bytes. +
If compiled with the `__DEBUG__` symbol, the function will not allow zero size
`xstrdup()`::
Allocates and copies the string 's' to a new memory location and returns it to the user. +
If compiled with the `__DEBUG__` symbol, the function will not allow 's' to be a `NULL` pointer
`xmemdup()`::
Allocates and copies `len` bytes from `ptr` to a new memory location and returns it to the user. +
If compiled with the `__DEBUG__` symbol, the function will not allow 'ptr' to be a `NULL` pointer
`xfree()`::
Free's a previous allocated block (pointed to by 'ptr') that is allocated by xmalloc/malloc. +
If compiled with the `__DEBUG__` symbol, the function will not allow 'ptr' to be a NULL pointer