on master help sign in
alloc_heap also requires the pointer alignment hack.
commit47cd264dbb9d22ff9ac71ebcc4c413d2da84539e authorstepcut <jeremy@n-heptane.com> dateMon 10 Mar 2014, 17:23 (13 years ago) parentffdb074
1 file changed+8−1
rts/idris_heap.c+8−1
rts/idris_heap.c+8−1
@@ -16,7 +16,14 @@ void alloc_heap(Heap * h, size_t heap_size)
1616 }
1717
1818 h->heap = mem;
19− h->next = h->heap;
19+#ifdef FORCE_ALIGNMENT
20+ if (((i_int)(h->heap)&1) == 1) {
21+ h->next = h->heap + 1;
22+ } else
23+#endif
24+ {
25+ h->next = h->heap;
26+ }
2027 h->end = h->heap + heap_size;
2128
2229 h->size = heap_size;