moved definition of HEAPSIZE to ikarus-data.h

This commit is contained in:
Abdulaziz Ghuloum 2007-12-20 03:51:43 -05:00
parent b915854677
commit d162c1cc25
4 changed files with 7 additions and 7 deletions

View File

@ -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,

View File

@ -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

View File

@ -2,6 +2,7 @@
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "ikarus-data.h"
#include <errno.h>

View File

@ -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;