Added more GC constants

This commit is contained in:
Justin Ethier 2016-04-20 22:07:14 -04:00
parent b4d67004fe
commit 9bcdd35370
3 changed files with 6 additions and 4 deletions

2
gc.c
View file

@ -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
// 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;
h_last = h;
while (h_last->next) {

View file

@ -28,8 +28,10 @@
// This is used as the first generation of the GC.
#define STACK_SIZE 500000
// Size of a "page" on the heap (the second generation), in bytes.
#define HEAP_SIZE (16 * 1024 * 1024)
// Parameters for size of a "page" on the heap (the second generation GC), in bytes.
#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

View file

@ -159,7 +159,7 @@ static bool set_insert(ck_hs_t *hs, const void *value)
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->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);