Use G_MEM_ALIGN when we have to determine the amount of padding needed instead of hard coding it to 8 bytes alignment.
Before: Allocation distribution (sizes include canaries): size < 32: 454120 size < 64: 401506 After: Allocation distribution (sizes include canaries): size < 32: 457281 size < 64: 398345 svn path=/trunk/; revision=30496
This commit is contained in:
parent
e00a9ba112
commit
cc6d443867
|
@ -604,7 +604,7 @@ emem_alloc(size_t size, emem_header_t *mem, gboolean use_chunks, guint8 *canary)
|
|||
if (use_canary)
|
||||
pad = emem_canary_pad(size);
|
||||
else
|
||||
pad = ((8 - (size & 0x7)) & 0x7);
|
||||
pad = (G_MEM_ALIGN - (size & (G_MEM_ALIGN-1))) & (G_MEM_ALIGN-1);
|
||||
|
||||
size += pad;
|
||||
|
||||
|
|
Loading…
Reference in New Issue