Index: src/runtime/Kernel/collector.c =================================================================== RCS file: /home/cvs/root/nhc98/src/runtime/Kernel/collector.c,v retrieving revision 1.24 retrieving revision 1.26 diff -u -r1.24 -r1.26 --- src/runtime/Kernel/collector.c 7 Mar 2005 16:53:38 -0000 1.24 +++ src/runtime/Kernel/collector.c 28 Mar 2006 09:21:11 -0000 1.26 @@ -9,6 +9,7 @@ /*#define HEAPSIZE 100000 -- defined in top-level Makefile at config-time */ #define GCSTACKSIZE 20000 +#define SBRK 1 /* Use sbrk(2) instead of malloc(3) to allocate the heap */ WHEN_DYNAMIC(int ractive = 0;) @@ -46,7 +47,13 @@ Int totalSize = hpSize+spSize; Int tableSize = (totalSize+WORDSIZE)/(WORDSIZE+1)+1; /* Last one for end of marked */ - if(NULL == (hpStart = malloc ((int)totalSize * sizeof(Node)))) { + if ( +#if SBRK + ((NodePtr)-1)== (hpStart = (NodePtr)sbrk((int)totalSize * sizeof(Node))) +#else + NULL == (hpStart = malloc ((int)totalSize * sizeof(Node))) +#endif + ) { fprintf(stderr,"Not enough memory for heap and stack.\n"); exit(-1); }