on master help sign in
Minor fix: detached heap reference
0489a72Sam T
rts/idris_rts.c+5−5
@@ -110,13 +110,13 @@ void* allocate(VM* vm, size_t size, int outerlock) {
110
110
111 size_t chunk_size = size + sizeof(size_t);
111 size_t chunk_size = size + sizeof(size_t);
112
112
113− if (vm -> heap_next + chunk_size < vm -> heap_end) {
113+ if (vm->heap.next + chunk_size < vm->heap.end) {
114 vm->allocations += chunk_size;
114 vm->allocations += chunk_size;
115− void* ptr = (void*)(vm->heap_next + sizeof(size_t));
115+ void* ptr = (void*)(vm->heap.next + sizeof(size_t));
116− *((size_t*)(vm->heap_next)) = chunk_size;
116+ *((size_t*)(vm->heap.next)) = chunk_size;
117− vm -> heap_next += chunk_size;
117+ vm->heap.next += chunk_size;
118
118
119− assert(vm->heap_next <= vm->heap_end);
119+ assert(vm->heap.next <= vm->heap.end);
120
120
121 memset(ptr, 0, size);
121 memset(ptr, 0, size);
122
122