diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-09-25 14:27:34 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-25 14:27:34 -0700 |
commit | cfdf646e9a818067887cdc9c01ade5b79f699190 (patch) | |
tree | 9b72a37341ccc6718cf23d6a3527ddb22d9a6d9e /hashtbl.c | |
parent | 3e1aaa9dd0cc48e390deb1c3f356b3ad1781af67 (diff) | |
download | nasm-cfdf646e9a818067887cdc9c01ade5b79f699190.tar.gz nasm-cfdf646e9a818067887cdc9c01ade5b79f699190.tar.bz2 nasm-cfdf646e9a818067887cdc9c01ade5b79f699190.zip |
Add nasm_zalloc() to nasmlib.c
Add nasm_zalloc(), a wrapper around calloc(), to allocate
zero-initialized memory. For large allocations, this is often far
more efficient than allocating and zeroing, since the operating system
tends to keep a pool of zero pages around.
Diffstat (limited to 'hashtbl.c')
-rw-r--r-- | hashtbl.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -15,9 +15,7 @@ static struct hash_tbl_node *alloc_table(size_t newsize) { size_t bytes = newsize*sizeof(struct hash_tbl_node); - struct hash_tbl_node *newtbl = nasm_malloc(bytes); - - memset(newtbl, 0, bytes); + struct hash_tbl_node *newtbl = nasm_zalloc(bytes); return newtbl; } |