diff options
Diffstat (limited to 'apps/plugins/pdbox/dbestfit-3.3/malloc.man')
| -rw-r--r-- | apps/plugins/pdbox/dbestfit-3.3/malloc.man | 190 |
1 files changed, 190 insertions, 0 deletions
diff --git a/apps/plugins/pdbox/dbestfit-3.3/malloc.man b/apps/plugins/pdbox/dbestfit-3.3/malloc.man new file mode 100644 index 0000000..79f6f3e --- /dev/null +++ b/apps/plugins/pdbox/dbestfit-3.3/malloc.man @@ -0,0 +1,190 @@ +MALLOC(3V) C LIBRARY FUNCTIONS MALLOC(3V) + + +NAME + malloc, free, realloc, calloc + +SYNOPSIS + #include <malloc.h> + + void *malloc(size) + size_t size; + + void free(ptr) + void *ptr; + + void *realloc(ptr, size) + void *ptr; + size_t size; + + void *calloc(nelem, elsize) + size_t nelem; + size_t elsize; + +DESCRIPTION + These routines provide a general-purpose memory allocation + package. They maintain a table of free blocks for efficient + allocation and coalescing of free storage. When there is no + suitable space already free, the allocation routines call + rn_getseg() to get more memory from the system. + + Each of the allocation routines returns a pointer to space + suitably aligned for storage of any type of object. Each + returns a NULL pointer if the request cannot be completed + (see DIAGNOSTICS). + + malloc() returns a pointer to a block of at least size + bytes, which is appropriately aligned. + + free() releases a previously allocated block. Its argument + is a pointer to a block previously allocated by malloc(), + calloc() or realloc(). + + realloc() changes the size of the block referenced by ptr to + size bytes and returns a pointer to the (possibly moved) + block. The contents will be unchanged up to the lesser of + the new and old sizes. If unable to honor a reallocation + request, realloc() leaves its first argument unaltered. + + **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW **** + + For backwards compatibility, realloc() accepts a pointer to a + block freed since the most recent call to malloc(), cal- + loc() or realloc(). + + Note: using realloc() with a block freed before the most recent + call to malloc(), calloc() or realloc() is an error. + + calloc() uses malloc() to allocate space for an array of + nelem elements of size elsize, initializes the space to + zeros, and returns a pointer to the initialized block. The + block should be freed with free(). + + + malloc() and realloc() return a non- NULL pointer if size is 0, + and calloc() returns a non-NULL pointer if nelem or elsize is 0, + but these pointers should not be dereferenced. + + Note: Always cast the value returned by malloc(), realloc() or + calloc(). + + +RETURN VALUES On success, malloc(), calloc() and realloc() return a + pointer to space suitably aligned for storage of any type of + object. On failure, they return NULL. + + free() does not return a value. + + +NOTES + Because malloc() and realloc() return a non-NULL pointer if size + is 0, and calloc() returns a non-NULL pointer if nelem or elsize + is 0, a zero size need not be treated as a special case if it + should be passed to these functions unpredictably. Also, the + pointer returned by these functions may be passed to subsequent + invocations of realloc(). + + +BUGS + + **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW **** + + Since realloc() accepts a pointer to a block freed since the last + call to malloc(), calloc() or realloc(), a degradation of + performance results. The semantics of free() should be changed + so that the contents of a previously freed block are undefined. +MALLOC(3V) C LIBRARY FUNCTIONS MALLOC(3V) + + +NAME + malloc, free, realloc, calloc + +SYNOPSIS + #include <malloc.h> + + void *malloc(size) + size_t size; + + void free(ptr) + void *ptr; + + void *realloc(ptr, size) + void *ptr; + size_t size; + + void *calloc(nelem, elsize) + size_t nelem; + size_t elsize; + +DESCRIPTION + These routines provide a general-purpose memory allocation + package. They maintain a table of free blocks for efficient + allocation and coalescing of free storage. When there is no + suitable space already free, the allocation routines call + rn_getseg() to get more memory from the system. + + Each of the allocation routines returns a pointer to space + suitably aligned for storage of any type of object. Each + returns a NULL pointer if the request cannot be completed + (see DIAGNOSTICS). + + malloc() returns a pointer to a block of at least size + bytes, which is appropriately aligned. + + free() releases a previously allocated block. Its argument + is a pointer to a block previously allocated by malloc(), + calloc() or realloc(). + + realloc() changes the size of the block referenced by ptr to + size bytes and returns a pointer to the (possibly moved) + block. The contents will be unchanged up to the lesser of + the new and old sizes. If unable to honor a reallocation + request, realloc() leaves its first argument unaltered. + + **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW **** + + For backwards compatibility, realloc() accepts a pointer to a + block freed since the most recent call to malloc(), cal- + loc() or realloc(). + + Note: using realloc() with a block freed before the most recent + call to malloc(), calloc() or realloc() is an error. + + calloc() uses malloc() to allocate space for an array of + nelem elements of size elsize, initializes the space to + zeros, and returns a pointer to the initialized block. The + block should be freed with free(). + + + malloc() and realloc() return a non- NULL pointer if size is 0, + and calloc() returns a non-NULL pointer if nelem or elsize is 0, + but these pointers should not be dereferenced. + + Note: Always cast the value returned by malloc(), realloc() or + calloc(). + + +RETURN VALUES On success, malloc(), calloc() and realloc() return a + pointer to space suitably aligned for storage of any type of + object. On failure, they return NULL. + + free() does not return a value. + + +NOTES + Because malloc() and realloc() return a non-NULL pointer if size + is 0, and calloc() returns a non-NULL pointer if nelem or elsize + is 0, a zero size need not be treated as a special case if it + should be passed to these functions unpredictably. Also, the + pointer returned by these functions may be passed to subsequent + invocations of realloc(). + + +BUGS + + **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW **** + + Since realloc() accepts a pointer to a block freed since the last + call to malloc(), calloc() or realloc(), a degradation of + performance results. The semantics of free() should be changed + so that the contents of a previously freed block are undefined. |