mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-07 05:06:36 +02:00
Forgot >= and instead used >
This makes a *HUGE* difference in performance, because otherwise it becomes problematic to re-use slots
This commit is contained in:
parent
31a2b276b3
commit
8f0a044e72
1 changed files with 1 additions and 1 deletions
2
gc.c
2
gc.c
|
@ -61,7 +61,7 @@ void *gc_try_alloc(gc_heap *h, size_t size)
|
||||||
// TODO: chunk size (ignoring for now)
|
// 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
|
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)?
|
// TODO: take whole chunk or divide up f2 (using f3)?
|
||||||
if (f2->size >= (size + gc_heap_align(1) /* min obj size */)) {
|
if (f2->size >= (size + gc_heap_align(1) /* min obj size */)) {
|
||||||
f3 = (gc_free_list *) (((char *)f2) + size);
|
f3 = (gc_free_list *) (((char *)f2) + size);
|
||||||
|
|
Loading…
Add table
Reference in a new issue