aboutsummaryrefslogtreecommitdiffstats
path: root/doc/info/chap/memory-allocation.texinfo
diff options
context:
space:
mode:
Diffstat (limited to 'doc/info/chap/memory-allocation.texinfo')
-rw-r--r--doc/info/chap/memory-allocation.texinfo16
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/info/chap/memory-allocation.texinfo b/doc/info/chap/memory-allocation.texinfo
index 0ef4982..20136b0 100644
--- a/doc/info/chap/memory-allocation.texinfo
+++ b/doc/info/chap/memory-allocation.texinfo
@@ -454,7 +454,7 @@ memory, which should be deallocated to avoid
memory leaks.
@end table
-@file{<malloc.h>} also includes three unportable
+@file{<malloc.h>} also includes four unportable
functions.
@table @code
@item void* zalloc(size_t size)
@@ -466,6 +466,18 @@ does not overflow, @code{calloc(a, b)} is identical
to @code{zalloc(a * b)}. @code{zalloc} is a
@command{klibc} extension.
+@item void* mallocz(size_t size, int clear)
+@fnindex mallocz
+This function is similar to @code{malloc}. However,
+it has one second parameter. If the second parameter
+is non-zero, the allocated memory will be initialised.
+
+@code{mallocz(size, clear)} is identical to
+@code{(clear ? zalloc : malloc)(size)}.
+
+This function is a Plan 9 from Bell Labs extension
+and requires @code{_PLAN9_SOURCE}.
+
@item void cfree(void* ptr, ...)
@fnindex cfree
This function is an obsolete function provided
@@ -473,7 +485,7 @@ by a number of C standard library implementations.
It has been replaced by @code{free}. @code{cfree}
is identical to @code{free}.
-Different implementions @command{libc}, defined
+Different implementions of @command{libc}, defined
@code{cfree} with different numbers of parameters,
therefore @code{slibc} declares @code{cfree} as
a variadic function, and ignores all but the first