@@ -118,14 +118,7 @@ void alloc_heap(Heap * h, size_t heap_size, size_t growth, char * old)
120 h->heap = mem;
120 h->heap = mem;
121−#ifdef FORCE_ALIGNMENT
122− if (((i_int)(h->heap)&1) == 1) {
123− h->next = h->heap + 1;
121+ h->next = aligned_heap_pointer(h->heap);
129 h->end = h->heap + heap_size;
122 h->end = h->heap + heap_size;
131 h->size = heap_size;
124 h->size = heap_size;
@@ -169,6 +162,17 @@ int ref_in_heap(Heap * heap, VAL v) {
169 return ((VAL)heap->heap <= v) && (v < (VAL)heap->next);
162 return ((VAL)heap->heap <= v) && (v < (VAL)heap->next);
165+char* aligned_heap_pointer(char * heap) {
166+#ifdef FORCE_ALIGNMENT
167+ if (((i_int)heap&1) == 1) {
172// Checks three important properties:
176// Checks three important properties:
173// 1. Closure.
177// 1. Closure.
174// Check if all pointers in the _heap_ points only to heap.
178// Check if all pointers in the _heap_ points only to heap.