aboutsummaryrefslogtreecommitdiffstats
path: root/xalloc.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-07-17 20:56:27 +0300
committerArnold D. Robbins <arnold@skeeve.com>2011-07-17 20:56:27 +0300
commit580aca5b46678fe0cdd341048bd10a36cca090c9 (patch)
tree3454d1e36233f278c3653bbe73b71eaa742bddab /xalloc.h
parent579ebbf934575b709ef409571094f65f4180b91c (diff)
downloadegawk-580aca5b46678fe0cdd341048bd10a36cca090c9.tar.gz
egawk-580aca5b46678fe0cdd341048bd10a36cca090c9.tar.bz2
egawk-580aca5b46678fe0cdd341048bd10a36cca090c9.zip
Sync dfa.c with GNU grep.
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