diff options
author | Camm Maguire <camm@debian.org> | 2014-04-08 17:07:38 +0000 |
---|---|---|
committer | Camm Maguire <camm@debian.org> | 2014-04-21 14:32:27 +0000 |
commit | 83c367df6bc0ef44c3373859057aba0ccc7f12a3 (patch) | |
tree | 72f4d36c24402f5dfa5c7f2c4d14e2c335e906e0 | |
parent | 8043404f521a1efba02202eb94c9fb256b4da351 (diff) | |
download | gcl-83c367df6bc0ef44c3373859057aba0ccc7f12a3.tar.gz |
let cygwin probe for maximum heap size
-rw-r--r-- | gcl/h/protoize.h | 2 | ||||
-rwxr-xr-x | gcl/o/unexnt.c | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/gcl/h/protoize.h b/gcl/h/protoize.h index 7585be51..0191ff8c 100644 --- a/gcl/h/protoize.h +++ b/gcl/h/protoize.h @@ -1680,7 +1680,7 @@ void recreate_heap1 ( void ); void gcl_init_shared_memory ( void ); void fix_filename ( object pathname, char *filename1 ); void alarm ( int n ); -void *sbrk ( unsigned long increment ); +void *sbrk ( ptrdiff_t increment ); void sigemptyset( sigset_t *set); void sigaddset ( sigset_t *set, int n); int sigismember ( sigset_t *set, int n ); diff --git a/gcl/o/unexnt.c b/gcl/o/unexnt.c index aa54cc20..8804877c 100755 --- a/gcl/o/unexnt.c +++ b/gcl/o/unexnt.c @@ -969,20 +969,24 @@ allocate_heap (void) the region below the 256MB line for our malloc arena - 229MB is still a pretty decent arena to play in! */ -#ifdef __CYGWIN__ - void *base = 0, *ptr; - reserved_heap_size = 512*1024*1024; +#if defined(__CYGWIN__) +#define PROBE_BASE NULL +#elif defined(__MINGW32__) +#define PROBE_BASE (void *)0x20000000 #else - void *base = (void *)0x20000000,*ptr;/*FIXME, someday figure out how to let the heap start address default *//*(void *)0x10100000*/ +#error Need PROBE_BASE +#endif + + void *base = PROBE_BASE,*ptr;/*FIXME, someday figure out how to let the heap start address default *//*(void *)0x10100000*/ reserved_heap_size=probe_heap_size(base,PAGESIZE,(1UL<<31),-1); -#endif ptr = VirtualAlloc ((void *) base,get_reserved_heap_size (),MEM_RESERVE,PAGE_NOACCESS); /* printf("probe results: %lu at %p\n",reserved_heap_size,ptr); */ DBEGIN = (DBEGIN_TY) ptr; return ptr; + } /* Emulate Unix sbrk. */ |