17 Apr
2014
17 Apr
'14
11:17 p.m.
On Thu, Apr 17, 2014 at 1:44 PM, Andrey Semashev wrote:
I'm not sure this is a good idea. Given that pointer size is 4 or 8 bytes (with the same alignment) on modern platforms and that the native malloc alignment is also 8 or 16 (on 32 and 64-bit platforms) already, you don't save anything. No sane memory allocator will allow you to allocate 1 byte at alignment 1 for example, it'll be 8 bytes at least. OTOH, I've seen cases when the compiler was not able to optimize away memcpy. I think rounding up the alignment was the right thing to do.
I see. Updated accordingly. (And merged to master) Glen