aboutsummaryrefslogtreecommitdiffstats
path: root/xalloc.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-10-09 21:22:55 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-10-09 21:22:55 +0200
commit06f3e569c7c153a5d0f2dc5667822c562e77ca9f (patch)
tree2a7c5ba3d7fa182edd3cf5d93d0629da22ae9880 /xalloc.h
parent194d9dc454d361ee5c707e71a5e3512fbe3a71cd (diff)
parent35d9ad9209592594905d1c8f15130d09af111411 (diff)
downloadegawk-06f3e569c7c153a5d0f2dc5667822c562e77ca9f.tar.gz
egawk-06f3e569c7c153a5d0f2dc5667822c562e77ca9f.tar.bz2
egawk-06f3e569c7c153a5d0f2dc5667822c562e77ca9f.zip
Merge branch 'gawk-4.0-stable'
Diffstat (limited to 'xalloc.h')
-rw-r--r--xalloc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/xalloc.h b/xalloc.h
index d859278d..5810fc55 100644
--- a/xalloc.h
+++ b/xalloc.h
@@ -281,6 +281,16 @@ xcharalloc (size_t n)
return XNMALLOC (n, char);
}
+/* Allocate S bytes of zeroed memory dynamically, with error checking.
+ There's no need for xnzalloc (N, S), since it would be equivalent
+ to xcalloc (N, S). */
+
+inline void *
+xzalloc (size_t s)
+{
+ return memset (xmalloc (s), 0, s);
+}
+
# endif
# ifdef __cplusplus