diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2006-10-31 21:41:16 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2006-10-31 21:41:16 +0300 |
commit | c2b10dc4d83b4bfba357eb6cfc4b7698dc8fef1c (patch) | |
tree | 90de2c2c6336df77e7916882eac81edc70b208ec /winsup/cygwin/mmap.cc | |
parent | 9740f34d11c458fd7a07a025810422a6db1ad374 (diff) |
* cygheap.h (struct user_heap_info): Add slop member.
* heap.cc (heap_init): Add slop factor to heap allocation. Add
comment.
* mmap.cc (MapViewNT): Allocate memory maps top down.
(fhandler_dev_zero::mmap): Ditto.
* shared.cc (shared_info::heap_slop_size): New method.
(shared_info::heap_chunk_size): Don't use debug_printf at early stage.
* shared_info.h (SHARED_INFO_CB): Accomodate change to shared_info.
(CURR_SHARED_MAGIC): Ditto.
(class shared_info): Add heap_slop member. Declare heap_slop_size.
* wincap.h: Define heapslop throughout.
* wincap.cc: Ditto.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r-- | winsup/cygwin/mmap.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 1c1afba57..31bac5869 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -350,7 +350,8 @@ MapViewNT (HANDLE h, void *addr, size_t len, DWORD openflags, void *base = addr; ULONG commitsize = attached (prot) ? 0 : len; ULONG viewsize = len; - ULONG alloc_type = base && !wincap.is_wow64 () ? AT_ROUND_TO_PAGE : 0; + ULONG alloc_type = (base && !wincap.is_wow64 () ? AT_ROUND_TO_PAGE : 0) + | MEM_TOP_DOWN; /* Try mapping using the given address first, even if it's NULL. If it failed, and addr was not NULL and flags is not MAP_FIXED, @@ -1669,7 +1670,8 @@ fhandler_dev_zero::mmap (caddr_t *addr, size_t len, int prot, when using the (non-POSIX, yay-Linux) MAP_NORESERVE flag. */ DWORD protect = gen_protect (prot, flags); - DWORD alloc_type = MEM_RESERVE | (noreserve (flags) ? 0 : MEM_COMMIT); + DWORD alloc_type = MEM_TOP_DOWN | MEM_RESERVE + | (noreserve (flags) ? 0 : MEM_COMMIT); base = VirtualAlloc (*addr, len, alloc_type, protect); if (!base && addr && !fixed (flags)) base = VirtualAlloc (NULL, len, alloc_type, protect); |