on master help sign in
Fix order of init in MKCDATA/c
08f3a5bNiklas Larsson
rts/idris_rts.c+2−2
@@ -287,18 +287,18 @@ char* GETSTROFF(VAL stroff) {
287}
287}
288
288
289VAL MKCDATA(VM* vm, CHeapItem * item) {
289VAL MKCDATA(VM* vm, CHeapItem * item) {
290+ c_heap_insert_if_needed(vm, &vm->c_heap, item);
290 Closure* cl = allocate(sizeof(Closure), 0);
291 Closure* cl = allocate(sizeof(Closure), 0);
291 SETTY(cl, CDATA);
292 SETTY(cl, CDATA);
292 cl->info.c_heap_item = item;
293 cl->info.c_heap_item = item;
293− c_heap_insert_if_needed(vm, &vm->c_heap, item);
294 return cl;
294 return cl;
295}
295}
296
296
297VAL MKCDATAc(VM* vm, CHeapItem * item) {
297VAL MKCDATAc(VM* vm, CHeapItem * item) {
298+ c_heap_insert_if_needed(vm, &vm->c_heap, item);
298 Closure* cl = allocate(sizeof(Closure), 1);
299 Closure* cl = allocate(sizeof(Closure), 1);
299 SETTY(cl, CDATA);
300 SETTY(cl, CDATA);
300 cl->info.c_heap_item = item;
301 cl->info.c_heap_item = item;
301− c_heap_insert_if_needed(vm, &vm->c_heap, item);
302 return cl;
302 return cl;
303}
303}
304
304
test/primitives006/load-test.idr+2−2
@@ -39,8 +39,8 @@ alloc x i = do
39
39
40main : IO ()
40main : IO ()
41main = do
41main = do
42− -- First allocate 4096 64M arrays to break the C heap if there's a bug
42+ -- First allocate 1024 64M arrays to break the C heap if there's a bug
43− alloc 0 4096 >>= printLn
43+ alloc 0 1024 >>= printLn
44
44
45 -- Then, test Bytes
45 -- Then, test Bytes
46 traverse_ (unit n . prim__truncInt_B8) [1..n]
46 traverse_ (unit n . prim__truncInt_B8) [1..n]