Until now, malloc_beebs and realloc_beebs returned non-aligned pointer and this behaviour could result in a performance penalty in some tests that use the heap, especially when executed on some architectures.
This commit makes malloc_beebs return pointers aligned to multiples of sizeof(void *), and also updates realloc_beebs to make use of that.
To avoid breaking changes, the padding is added to heap_requested.
This commit also makes the static array used as a heap in sglib-combined and huffbench aligned. This is obtained through the __attribute__((aligned)) directive as it seems to be well supported across compilers.
Fix issue #116.
Until now,
malloc_beebs
andrealloc_beebs
returned non-aligned pointer and this behaviour could result in a performance penalty in some tests that use the heap, especially when executed on some architectures.This commit makes
malloc_beebs
return pointers aligned to multiples ofsizeof(void *)
, and also updatesrealloc_beebs
to make use of that.To avoid breaking changes, the padding is added to heap_requested.
This commit also makes the static array used as a heap in sglib-combined and huffbench aligned. This is obtained through the
__attribute__((aligned))
directive as it seems to be well supported across compilers.