]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zed/zed_strings.c
Replace zed's use of malloc with calloc
authorChris Dunlap <cdunlap@llnl.gov>
Mon, 22 Sep 2014 20:22:48 +0000 (13:22 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 25 Sep 2014 20:43:57 +0000 (13:43 -0700)
commit8cb8cf91df8a4902025d814b62b9332ad1b291c7
tree983b9c5daf33db035df66928735d336230fc9aca
parentbee6665b88fca3b5e70e8b3c8f6281975721c7be
Replace zed's use of malloc with calloc

When zed allocates memory via malloc(), it typically follows that
with a memset().  However, calloc() implementations can often perform
optimizations when zeroing memory:

https://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc

This commit replaces zed's use of malloc() with calloc().

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2736
cmd/zed/zed_conf.c
cmd/zed/zed_exec.c
cmd/zed/zed_strings.c