malloc_beebs does not ensure correct alignment of allocated objects
edward-jones opened this issue · 1 comments
edward-jones commented
The custom malloc in embench does not ensure that allocated objects are correctly aligned. For architectures where unaligned accesses are not valid this will cause incorrect behaviour in the benchmarks which rely on the heap, on architectures where unaligned accesses are slow this could cause inconsistent benchmark performance.
There is also a secondary problem that the pointer passed to init_heap_beebs
from the benchmarks needs to be aligned to the maximum alignment of any object for the target architecture. This is a problem in sglib-combined where the heap is a simple char array.
3rror commented
I think I managed to fix this issue, but someone should review the code and maybe test it on other architectures.