mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 04:55:04 +02:00
Fast-track heap page size for a large allocation
This commit is contained in:
parent
10286604e6
commit
558c7d8257
1 changed files with 6 additions and 1 deletions
7
gc.c
7
gc.c
|
@ -448,8 +448,13 @@ int gc_grow_heap(gc_heap * h, int heap_type, size_t size, size_t chunk_size)
|
||||||
}
|
}
|
||||||
h_last = h_last->next;
|
h_last = h_last->next;
|
||||||
}
|
}
|
||||||
if (new_size == 0)
|
if (new_size == 0) {
|
||||||
new_size = prev_size + h_last->size;
|
new_size = prev_size + h_last->size;
|
||||||
|
}
|
||||||
|
// Fast-track heap page size if allocating a large block
|
||||||
|
if (new_size < size && size < HEAP_SIZE) {
|
||||||
|
new_size = HEAP_SIZE;
|
||||||
|
}
|
||||||
#if GC_DEBUG_TRACE
|
#if GC_DEBUG_TRACE
|
||||||
fprintf(stderr, "Growing heap %d new page size = %zu\n", heap_type,
|
fprintf(stderr, "Growing heap %d new page size = %zu\n", heap_type,
|
||||||
new_size);
|
new_size);
|
||||||
|
|
Loading…
Add table
Reference in a new issue