mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Added more GC constants
This commit is contained in:
parent
b4d67004fe
commit
9bcdd35370
3 changed files with 6 additions and 4 deletions
2
gc.c
2
gc.c
|
@ -393,7 +393,7 @@ int gc_grow_heap(gc_heap *h, int heap_type, size_t size, size_t chunk_size)
|
||||||
// so for now it is not used. If it is used again, the initial heaps will
|
// so for now it is not used. If it is used again, the initial heaps will
|
||||||
// need to start at a lower size (EG 1 MB).
|
// need to start at a lower size (EG 1 MB).
|
||||||
{
|
{
|
||||||
size_t prev_size = 2 * 1024 * 1024;
|
size_t prev_size = GROW_HEAP_BY_SIZE;
|
||||||
new_size = 0;
|
new_size = 0;
|
||||||
h_last = h;
|
h_last = h;
|
||||||
while (h_last->next) {
|
while (h_last->next) {
|
||||||
|
|
|
@ -28,8 +28,10 @@
|
||||||
// This is used as the first generation of the GC.
|
// This is used as the first generation of the GC.
|
||||||
#define STACK_SIZE 500000
|
#define STACK_SIZE 500000
|
||||||
|
|
||||||
// Size of a "page" on the heap (the second generation), in bytes.
|
// Parameters for size of a "page" on the heap (the second generation GC), in bytes.
|
||||||
#define HEAP_SIZE (16 * 1024 * 1024)
|
#define GROW_HEAP_BY_SIZE (2 * 1024 * 1024) // Grow first page by adding this amount to it
|
||||||
|
#define INITIAL_HEAP_SIZE (3 * 1024 * 1024) // Size of the first page
|
||||||
|
#define HEAP_SIZE (16 * 1024 * 1024) // Normal size of a page
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Major GC tuning parameters
|
// Major GC tuning parameters
|
||||||
|
|
|
@ -159,7 +159,7 @@ static bool set_insert(ck_hs_t *hs, const void *value)
|
||||||
|
|
||||||
void gc_init_heap(long heap_size)
|
void gc_init_heap(long heap_size)
|
||||||
{
|
{
|
||||||
size_t initial_heap_size = 3 * 1024 * 1024;
|
size_t initial_heap_size = INITIAL_HEAP_SIZE;
|
||||||
Cyc_heap = malloc(sizeof(gc_heap_root));
|
Cyc_heap = malloc(sizeof(gc_heap_root));
|
||||||
Cyc_heap->heap = gc_heap_create(HEAP_REST, initial_heap_size, 0, 0);
|
Cyc_heap->heap = gc_heap_create(HEAP_REST, initial_heap_size, 0, 0);
|
||||||
Cyc_heap->small_obj_heap = gc_heap_create(HEAP_SM, initial_heap_size, 0, 0);
|
Cyc_heap->small_obj_heap = gc_heap_create(HEAP_SM, initial_heap_size, 0, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue