Hi, I hacked wine to enable 3GB user address space just like the /3GB boot.ini option for windows. ( see patch ) This actually works like a charm playing everquest2 which crashes from time to time without this patch due to running out of memory.
To do it right, should this "3GB Option" be enabled by a wine start parameter or a registry key ? Is the registry already setup during the call of libs/wine/mmap.c ?
Bye Stefan Reimer
diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c index a49df99..61dd2be 100644 --- a/dlls/kernel32/cpu.c +++ b/dlls/kernel32/cpu.c @@ -383,7 +383,7 @@ VOID WINAPI GetSystemInfo(
/* FIXME: the two entries below should be computed somehow... */ cachedsi.lpMinimumApplicationAddress = (void *)0x00010000; - cachedsi.lpMaximumApplicationAddress = (void *)0x7FFEFFFF; + cachedsi.lpMaximumApplicationAddress = (void *)0xBFFEFFFF; cachedsi.dwActiveProcessorMask = 0; cachedsi.dwNumberOfProcessors = 1; cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM; diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c index 9931c09..aec818f 100644 --- a/dlls/kernel32/heap.c +++ b/dlls/kernel32/heap.c @@ -1336,7 +1336,7 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
/* FIXME: should do something for other systems */ GetSystemInfo(&si); - lpmemex->ullTotalVirtual = (char*)si.lpMaximumApplicationAddress-(char*)si.lpMinimumApplicationAddress; + lpmemex->ullTotalVirtual = (unsigned long)si.lpMaximumApplicationAddress-(unsigned long)si.lpMinimumApplicationAddress; /* FIXME: we should track down all the already allocated VM pages and substract them, for now arbitrarily remove 64KB so that it matches NT */ lpmemex->ullAvailVirtual = lpmemex->ullTotalVirtual-64*1024;
diff --git a/libs/wine/mmap.c b/libs/wine/mmap.c index ff117cc..6ae6664 100644 --- a/libs/wine/mmap.c +++ b/libs/wine/mmap.c @@ -346,7 +346,7 @@ void mmap_init(void) #if defined(__i386__) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) /* commented out until FreeBSD gets fixed */ char stack; char * const stack_ptr = &stack; - char *user_space_limit = (char *)0x7ffe0000; + char *user_space_limit = (char *)0xbffe0000;
reserve_malloc_space( 8 * 1024 * 1024 );