diff --git a/sms_src/examples/generateRGBImg.sms b/sms_src/examples/generateRGBImg.sms index f9b448f..2c954d7 100755 --- a/sms_src/examples/generateRGBImg.sms +++ b/sms_src/examples/generateRGBImg.sms @@ -1,4 +1,4 @@ -#!/usr/local/bin/sms -m64 +#!/usr/local/bin/sms -m256 # Usage: This script demonstrates creating a rainbow gradient using colorTGA.write { diff --git a/src/main/memory/sm_gc.c b/src/main/memory/sm_gc.c index 4d43e48..7d9d7e1 100644 --- a/src/main/memory/sm_gc.c +++ b/src/main/memory/sm_gc.c @@ -166,13 +166,14 @@ void sm_inflate_heap(sm_heap *from, sm_heap *to) { // Copying GC void sm_garbage_collect() { if (sms_heap->used != 0) { + // Fill in the heap map sm_heap_scan(sms_heap); // Build "to" heap if necessary, same size as current if (sms_other_heap == NULL) sms_other_heap = sm_new_heap(sms_heap->capacity, true); - // Clear for when we recycle a heap + // Clear other heap for when we recycle a heap sm_heap_clear(sms_other_heap); - // Try to shake off objects from callstack with some unregistered spacers + // Try to shake off objects from callstack with unregistered spacer if (evaluating) sm_new_space_at(sms_other_heap, (sm_gc_count(0) % 16) * 8); // Copy root (global context) diff --git a/src/main/object/sm_space.c b/src/main/object/sm_space.c index 181aab1..a9f3f4b 100644 --- a/src/main/object/sm_space.c +++ b/src/main/object/sm_space.c @@ -4,7 +4,7 @@ // General purpose space of memory sm_space *sm_new_space(uint32_t size) { - sm_space *new_space = sm_malloc(sizeof(sm_space) + sm_round_size(size)); + sm_space *new_space = sm_malloc(sizeof(sm_space) + sm_round_size64(size)); new_space->my_type = SM_SPACE_TYPE; new_space->size = size; return new_space;