-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make custom malloc & realloc return aligned pointers
Fix issue #116. 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. Reported-by: Edward Jones Signed-off-by: Gianluca Andreotti <[email protected]>
- Loading branch information
Showing
3 changed files
with
37 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters