diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-10-11 08:20:40 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-10-11 08:20:40 +0000 |
commit | cc6d443867f635011889640f2e96258ccb4e9331 (patch) | |
tree | 789f7c1874047061d988253928870deec5932917 /epan/emem.c | |
parent | e00a9ba112858f08c38c9c54c2be96e4a93f5970 (diff) |
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
Diffstat (limited to 'epan/emem.c')
-rw-r--r-- | epan/emem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/emem.c b/epan/emem.c index c4afedeedd..47462626d9 100644 --- a/epan/emem.c +++ b/epan/emem.c @@ -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; |