gc.c (mrb_obj_alloc): clarify the heap initialization

This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-07-08 07:59:23 +09:00
parent eebbc6eaa4
commit 9c61c66045
+2 -3
View File
@@ -490,11 +490,10 @@ mrb_obj_alloc(mrb_state *mrb, enum mrb_vtype ttype, struct RClass *cls)
mrb_incremental_gc(mrb);
}
mrb_heap_page *page = gc->heaps;
if (page == NULL) {
if (gc->heaps == NULL) {
add_heap(mrb, gc);
page = gc->heaps;
}
mrb_heap_page *page = gc->heaps;
while (page->freelist == NULL) {
page = page->next;
if (page == NULL) {