From 8f0a044e726e3e81467a6d6e764e7635fc03ec87 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 23 Oct 2015 22:52:07 -0400 Subject: [PATCH] Forgot >= and instead used > This makes a *HUGE* difference in performance, because otherwise it becomes problematic to re-use slots --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc.c b/gc.c index 8bc85749..213e5d83 100644 --- a/gc.c +++ b/gc.c @@ -61,7 +61,7 @@ void *gc_try_alloc(gc_heap *h, size_t size) // TODO: chunk size (ignoring for now) for (f1 = h->free_list, f2 = f1->next; f2; f1 = f2, f2 = f2->next) { // all free in this heap - if (f2->size > size) { // Big enough for request + if (f2->size >= size) { // Big enough for request // TODO: take whole chunk or divide up f2 (using f3)? if (f2->size >= (size + gc_heap_align(1) /* min obj size */)) { f3 = (gc_free_list *) (((char *)f2) + size);