HomeFreeBSD

Replace zed's use of malloc with calloc

Description

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

Details

Provenance
Chris Dunlap <cdunlap@llnl.gov>Authored on Sep 22 2014, 8:22 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 25 2014, 8:43 PM
Parents
rGbee6665b88fc: Fix zed io-spare.sh dash incompatibility
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG8cb8cf91df8a: Replace zed's use of malloc with calloc (authored by Chris Dunlap <cdunlap@llnl.gov>).Sep 25 2014, 8:43 PM