Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Removed unused alignment/padding calculation from zmalloc macros #4770
The alignment/padding calculations in update_zmalloc_stat_(alloc|free) currently do nothing, haven't been used since thread safe mode was removed, and were probably broken years before that as they were used only for incrementation in the thread safe case. As the padding is accounted for in all calls to update_zmalloc_stat_(alloc|free) by the caller either using zmalloc_size or explicit addition of PREFIX_SIZE, they no longer appear to be needed here.
See issue #4739
I check the commit which is 3 years before now, both thread_safe and non_thread_safe mode use the variable _n.
However I personally support your solution.
I am using zmalloc to count used memory in my project, and I changed the behavior of
commit is here (wkgcass/nanovm@e58f67f)
I suggest redis do the same. But looking back to the commit history, maybe maintainers would like to keep the alignment.