ntdll: Specify location of virtual heap on FreeBSD.

Tijl Coosemans tijl at ulyssis.org
Fri Dec 26 10:20:17 CST 2008


On FreeBSD the virtual heap is currently allocated at the start of
address space and overlaps with the location of execatables. Most
executables (non-relocatable) fail to start.

---
 dlls/ntdll/virtual.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

-------------- next part --------------
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index bda8be1..7a0a6af 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1308,9 +1308,13 @@ void virtual_init(void)
         }
     }
 
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+    heap_base = wine_anon_mmap( (void *)0x81000000, VIRTUAL_HEAP_SIZE, PROT_READ|PROT_WRITE, 0 );
+#else
     /* try to find space in a reserved area for the virtual heap */
     if (!wine_mmap_enum_reserved_areas( alloc_virtual_heap, &heap_base, 1 ))
         heap_base = wine_anon_mmap( NULL, VIRTUAL_HEAP_SIZE, PROT_READ|PROT_WRITE, 0 );
+#endif
 
     assert( heap_base != (void *)-1 );
     virtual_heap = RtlCreateHeap( HEAP_NO_SERIALIZE, heap_base, VIRTUAL_HEAP_SIZE,


More information about the wine-patches mailing list