on master help sign in
Implement second part of FORCE_ALIGNMENT fix for arduino targets.

When FORCE_ALIGNMENT was introduced for pointer aligment on 8-bit arduino targets (See idris-lang@47cd264) it was not applied to the initialization of the cheney algorithm during garbage collection. The fix modifies the start of the heap location in the same way the FORCE_ALIGNMENT-define does for the initialization of the FP-heap in alloc_heap(...) in file idris_heap.c.

commit376db080f2db3de38d6ad77e5aab5bdc04a65f22 authorXeFias <xefias@gmail.com> dateThu 5 Jan 2017, 20:00 (10 years ago) parent4c91479
1 file changed+10−1
rts/idris_gc.c+10−1
rts/idris_gc.c+10−1
@@ -73,7 +73,16 @@ VAL copy(VM* vm, VAL x) {
7373void cheney(VM *vm) {
7474 int i;
7575 int ar;
76− char* scan = vm->heap.heap;
76+ char* scan = NULL;
77+
78+#ifdef FORCE_ALIGNMENT
79+ if (((i_int)(vm->heap.heap)&1) == 1) {
80+ scan = vm->heap.heap + 1;
81+ } else
82+#endif
83+ {
84+ scan = vm->heap.heap;
85+ }
7786
7887 while(scan < vm->heap.next) {
7988 size_t inc = *((size_t*)scan);