ARM has stricter alignment rules than many other architectures. In this case, pageheap_memory is being declared as a char array, so it is not aligned by the compiler. It is later used as TCMalloc_PageHeap*, which does require alignment. When building under ARM, this patch tells the compiler to stricly align pageheap_memory so that pageheap_memory can be used as TCMalloc_PageHeap*. It does not affect other platforms.
Created attachment 13292 [details] Fix ARM crash due to mis-alignment
Comment on attachment 13292 [details] Fix ARM crash due to mis-alignment I think there's a more-portable way to solve this problem. We could make pageheap_memory be an array of pointers instead of an array of char. That would ive us the alignment we need to store pointers in it. static void* pageheap_memory[(sizeof(TCMalloc_PageHeap) + sizeof(void*) - 1) / sizeof(void*)]; What do you think?
I agree with Darin. I think it is better to enforce the alignment in a portable way, by making the array be a pointer array or the like.
Created attachment 13312 [details] Fix ARM crash due to mis-alignment - rev2
Sounds good to me. I've attached a modified patch with Darin's suggestion.
Comment on attachment 13312 [details] Fix ARM crash due to mis-alignment - rev2 r=me
Landed in r19791.