zfsonlinux/zfs — pull request #2736 by dun (2014-09-24 00:00:08+00:00)
Title: 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().

Since these memory allocations are typically quite small, switching to calloc() isn't currently expected to offer any noticeable performance improvement. But it's not inconceivable that MMAP_THRESHOLD could be reached as additional nvpairs are added to events over time.