on master help sign in
Minor fix: detached heap reference
commit0489a720b645874335409a2f311f1a8334c63b04 authorSam T <sta.cs.vsu@gmail.com> dateFri 15 Mar 2013, 01:30 (14 years ago) parent839cb2b
1 file changed+5−5
rts/idris_rts.c+5−5
rts/idris_rts.c+5−5
@@ -110,13 +110,13 @@ void* allocate(VM* vm, size_t size, int outerlock) {
110110
111111 size_t chunk_size = size + sizeof(size_t);
112112
113− if (vm -> heap_next + chunk_size < vm -> heap_end) {
113+ if (vm->heap.next + chunk_size < vm->heap.end) {
114114 vm->allocations += chunk_size;
115− void* ptr = (void*)(vm->heap_next + sizeof(size_t));
116− *((size_t*)(vm->heap_next)) = chunk_size;
117− vm -> heap_next += chunk_size;
115+ void* ptr = (void*)(vm->heap.next + sizeof(size_t));
116+ *((size_t*)(vm->heap.next)) = chunk_size;
117+ vm->heap.next += chunk_size;
118118
119− assert(vm->heap_next <= vm->heap_end);
119+ assert(vm->heap.next <= vm->heap.end);
120120
121121 memset(ptr, 0, size);
122122