Changeset 128818 in webkit
- Timestamp:
- Sep 17, 2012 4:00:32 PM (12 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r128796 r128818 1 2012-09-17 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r128796. 4 http://trac.webkit.org/changeset/128796 5 https://bugs.webkit.org/show_bug.cgi?id=96966 6 7 It broke everything (Requested by Ossy_NIGHT on #webkit). 8 9 * wtf/OSAllocatorPosix.cpp: 10 (WTF::OSAllocator::reserveUncommitted): 11 (WTF::OSAllocator::reserveAndCommit): 12 (WTF::OSAllocator::commit): 13 (WTF::OSAllocator::decommit): 14 1 15 2012-09-17 Uli Schlachter <psychon@znc.in> 2 16 -
trunk/Source/WTF/wtf/OSAllocatorPosix.cpp
r128796 r128818 42 42 if (result == MAP_FAILED) 43 43 CRASH(); 44 #el if OS(LINUX)45 void* result = mmap(0, bytes, PROT_NONE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1, 0); 46 if (result == MAP_FAILED)47 CRASH(); 44 #else // OS(QNX) 45 46 void* result = reserveAndCommit(bytes, usage, writable, executable, includesGuardPages); 47 #if OS(LINUX) 48 48 madvise(result, bytes, MADV_DONTNEED); 49 #else 50 void* result = reserveAndCommit(bytes, usage, writable, executable, includesGuardPages); 51 #if HAVE(MADV_FREE_REUSE) 49 #elif HAVE(MADV_FREE_REUSE) 52 50 // To support the "reserve then commit" model, we have to initially decommit. 53 51 while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { } … … 72 70 if (executable) 73 71 flags |= MAP_JIT; 72 #endif 73 74 #if (OS(LINUX) && CPU(X86_64)) 75 // Linux distros usually do not allow overcommit by default, so 76 // JSC's strategy of mmaping a large amount of memory upfront 77 // won't work very well on some systems. Fortunately there's a 78 // flag we can pass to mmap to disable the overcommit check for 79 // this particular call, so we can get away with it as long as the 80 // overcommit flag value in /proc/sys/vm/overcommit_memory is 0 81 // ('heuristic') and not 2 (always check). 0 is the usual default 82 // value, so this should work well in general. 83 flags |= MAP_NORESERVE; 74 84 #endif 75 85 … … 132 142 CRASH(); 133 143 #elif OS(LINUX) 134 int protection = PROT_READ; 135 if (writable) 136 protection |= PROT_WRITE; 137 if (executable) 138 protection |= PROT_EXEC; 139 if (!mprotect(address, bytes, protection)) 140 CRASH(); 144 UNUSED_PARAM(writable); 145 UNUSED_PARAM(executable); 141 146 madvise(address, bytes, MADV_WILLNEED); 142 147 #elif HAVE(MADV_FREE_REUSE) … … 160 165 #elif OS(LINUX) 161 166 madvise(address, bytes, MADV_DONTNEED); 162 if (!mprotect(address, bytes, PROT_NONE))163 CRASH();164 167 #elif HAVE(MADV_FREE_REUSE) 165 168 while (madvise(address, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
Note: See TracChangeset
for help on using the changeset viewer.