This is a broader application of optimizations to malloc() and free() in f4a0f32d (Fast-path improvement: reduce # of branches and unnecessary operations.). This resolves #321.