]> Kevux Git Server - fll/commit
Update: Improve performance by removing redundant memset().
authorKevin Day <thekevinday@gmail.com>
Sun, 12 Dec 2021 05:59:06 +0000 (23:59 -0600)
committerKevin Day <thekevinday@gmail.com>
Sun, 12 Dec 2021 06:02:38 +0000 (00:02 -0600)
commitc567ef798e17b0c91b4eff17157140c175b71f84
treee3583ecd2fbb4c66c2a56c07fd1cf4d8449152b4
parentde4615ea5e4ec8210ca6b7bfc4006ac173156f2e
Update: Improve performance by removing redundant memset().

The calloc() program is supposed to guarantee 0 filled data.
Either the libc or the kernel know how to optimize this automatically using numerous tricks based on architecture or lack thereof.
This makes calloc() potentially faster than malloc()+memset().

Calling calloc()+memset() is just ridiculous.
Remove the calls to memset() that follow a calloc() call.
This is guaranteed to be a performance increase (but how much? I didn't bother trying to find out).

Cleanup some comments.
level_0/f_memory/c/memory.c
level_0/f_memory/c/private-memory.c