Commit 62b206e
authored
Force alignment of allocated memory to prevent segmentation faults on ARM systems (#224)
* Force alignment of allocated memory. Without this change, I have noticed crashes on ARM based devices which have stricter alignment requirements than x86. Ideally, this code should be rewritten to pad the sizes of all "structs" and to consider all of the different architecture-specific alignment requirements. But in practice, I suspect that rounding up allocation sizes to a multiple of pointer sizes is likely good enough. This is a pragmatic one-line change that shouldn't break existing code and should prevent any of the crashes that I have observed.
* Added a few more memory alignments when using both primary and extra memory in a back-to-back memory allocation.1 parent 4a34966 commit 62b206e
2 files changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
| 1039 | + | |
| 1040 | + | |
1039 | 1041 | | |
1040 | 1042 | | |
1041 | 1043 | | |
| |||
1095 | 1097 | | |
1096 | 1098 | | |
1097 | 1099 | | |
| 1100 | + | |
1098 | 1101 | | |
1099 | 1102 | | |
1100 | 1103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
| 483 | + | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| |||
0 commit comments