aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-06-21 09:57:24 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-06-21 09:57:24 -0400
commitb7d8b6ebcd5dd714bc21acf7637d9a651e2f7ea7 (patch)
tree8fa6a43eb6bb9597c8fe5ee9a67d3e318cb5f1ad /doc/gawk.texi
parent4264c894681d11d4a5ce694aa8040223726fad1e (diff)
downloadegawk-b7d8b6ebcd5dd714bc21acf7637d9a651e2f7ea7.tar.gz
egawk-b7d8b6ebcd5dd714bc21acf7637d9a651e2f7ea7.tar.bz2
egawk-b7d8b6ebcd5dd714bc21acf7637d9a651e2f7ea7.zip
Add ezalloc macro in gawk and API to allocate zero-filled memory.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi10
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 79292a00..afdefff4 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -32978,8 +32978,8 @@ to use its version of @code{free()} when the memory came from an
unrelated version of @code{malloc()}, unexpected behavior would
likely result.
-Two convenience macros may be used for allocating storage
-from @code{gawk_malloc()} and
+Three convenience macros may be used for allocating storage
+from @code{gawk_malloc()}, @code{gawk_calloc}, and
@code{gawk_realloc()}. If the allocation fails, they cause @command{gawk}
to exit with a fatal error message. They should be used as if they were
procedure calls that do not return a value:
@@ -33018,6 +33018,12 @@ strcpy(message, greet);
make_malloced_string(message, strlen(message), & result);
@end example
+@item #define ezalloc(pointer, type, size, message) @dots{}
+This is like @code{emalloc()}, but it calls @code{gawk_calloc()}
+instead of @code{gawk_malloc()}.
+The arguments are the same as for the @code{emalloc()} macro, but this
+macro guarantees that the memory returned is initialized to zero.
+
@item #define erealloc(pointer, type, size, message) @dots{}
This is like @code{emalloc()}, but it calls @code{gawk_realloc()}
instead of @code{gawk_malloc()}.