From dd88fe9cff0b53154b74f447e26861c3c74277b6 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 16 Nov 2015 19:48:05 +0100 Subject: info: doc mallocz MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/info/chap/memory-allocation.texinfo | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'doc/info/chap') 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{} also includes three unportable +@file{} 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 -- cgit v1.2.3-70-g09d2