diff options
Diffstat (limited to 'lib/libc/stdlib/malloc.3')
-rw-r--r-- | lib/libc/stdlib/malloc.3 | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3 index 9782588..479ab00 100644 --- a/lib/libc/stdlib/malloc.3 +++ b/lib/libc/stdlib/malloc.3 @@ -34,7 +34,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)malloc.3 8.1 (Berkeley) 6/4/93 -.\" $Id: malloc.3,v 1.9 1997/03/22 23:48:12 mpp Exp $ +.\" $Id: malloc.3,v 1.10 1997/05/30 20:39:32 phk Exp $ .\" .Dd August 27, 1996 .Dt MALLOC 3 @@ -149,6 +149,11 @@ This can substantially aid in compacting memory. ``utrace'' generate entries for ktrace(1) for all operations. Consult the source for this one. +.It V +``sysV'' operations that attempt to allocate zero bytes will +return a null pointer. Be aware of the conflict if you also +have ``X'' set. + .It X ``xmalloc'' rather than return failure, @@ -217,7 +222,7 @@ Here is a brief description of the error messages and what they mean: .Pp ``(ES): mumble mumble mumble'': malloc have been compiled with -DEXTRA_SANITY and something looks -fishy in there. Consult sources and or wizards. +fishy in there. Consult sources and/or wizards. .Pp ``allocation failed'' if the ``A'' option is specified it is an error for @@ -272,6 +277,13 @@ would be possible to add a sigblock() around this package, but it would have a performance penalty that is not acceptable as the default. .Pp +``out of memory'' +The ``X'' flag is active and an allocation of memory failed. +.Pp +``open of /dev/zero'' +On certain architectures /dev/zero is used as a source of +anonymous pages for the page directory, opening failed. +.Pp ``unknown char in MALLOC_OPTIONS'' we found something we didn't understand. .Sh SEE ALSO @@ -286,6 +298,9 @@ The .Fn malloc function conforms to .St -ansiC . +.Sh BUGS +It can be argued that returning a null pointer when asked to +allocate zero bytes is a silly response to a silly question. .Sh HISTORY The present implementation of malloc started out as a filesystem on a drum attached to a 20bit binary challenged computer built with discrete germanium @@ -293,7 +308,7 @@ transistors, and it has since graduated to handle primary storage rather than secondary. .Pp The main difference from other malloc implementations are believed to be that -the free pages are not accessed until allocated. +the free pages are not accessed unless allocated. Most malloc implementations will store a data structure containing a, possibly double-, linked list in the free chunks of memory, used to tie all the free memory together. |