diff --git a/src/ikarus-collect.c b/src/ikarus-collect.c index e1701ba..519bf67 100644 --- a/src/ikarus-collect.c +++ b/src/ikarus-collect.c @@ -505,12 +505,11 @@ ik_collect(int mem_req, ikpcb* pcb){ int free_space = ((unsigned int)pcb->allocation_redline) - ((unsigned int)pcb->allocation_pointer); - #define HEAPSIZE (1024 * 4096) - if((free_space <= mem_req) || (pcb->heap_size < HEAPSIZE)){ + if((free_space <= mem_req) || (pcb->heap_size < IK_HEAPSIZE)){ #ifndef NDEBUG fprintf(stderr, "REQ=%d, got %d\n", mem_req, free_space); #endif - int memsize = (mem_req>HEAPSIZE) ? mem_req : HEAPSIZE; + int memsize = (mem_req > IK_HEAPSIZE) ? mem_req : IK_HEAPSIZE; memsize = align_to_next_page(memsize); ik_munmap_from_segment( pcb->heap_base, diff --git a/src/ikarus-data.h b/src/ikarus-data.h index ac1f03c..f3c0863 100644 --- a/src/ikarus-data.h +++ b/src/ikarus-data.h @@ -294,6 +294,7 @@ ikp ik_safe_alloc(ikpcb* pcb, int size); #define IK_OFF_CAR (IK_DISP_CAR - IK_PAIR_TAG) #define IK_OFF_CDR (IK_DISP_CDR - IK_PAIR_TAG) #define IK_HEAP_EXT_SIZE (32 * 4096) +#define IK_HEAPSIZE (1024 * 4096) /* 4 MB */ #define IK_PAIRP(x) (IK_PTAG(x) == IK_PAIR_TAG) #define IK_CHARP(x) (IK_MASK(x,IK_CHAR_MASK) == IK_CHAR_TAG) #define IK_STRING_TAG 6 diff --git a/src/ikarus-process.c b/src/ikarus-process.c index b53356a..7c4926f 100644 --- a/src/ikarus-process.c +++ b/src/ikarus-process.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "ikarus-data.h" #include diff --git a/src/ikarus-runtime.c b/src/ikarus-runtime.c index 52c37c2..ac81991 100644 --- a/src/ikarus-runtime.c +++ b/src/ikarus-runtime.c @@ -279,13 +279,12 @@ ikpcb* ik_make_pcb(){ ikpcb* pcb = ik_malloc(sizeof(ikpcb)); bzero(pcb, sizeof(ikpcb)); pcb->collect_key = false_object; - #define HEAPSIZE (1024 * 4096) #define STAKSIZE (1024 * 4096) //#define STAKSIZE (256 * 4096) - pcb->heap_base = ik_mmap(HEAPSIZE); - pcb->heap_size = HEAPSIZE; + pcb->heap_base = ik_mmap(IK_HEAPSIZE); + pcb->heap_size = IK_HEAPSIZE; pcb->allocation_pointer = pcb->heap_base; - pcb->allocation_redline = pcb->heap_base + HEAPSIZE - 2 * 4096; + pcb->allocation_redline = pcb->heap_base + IK_HEAPSIZE - 2 * 4096; pcb->stack_base = ik_mmap(STAKSIZE); pcb->stack_size = STAKSIZE;