Changeset 286818 in webkit
- Timestamp:
- Dec 9, 2021, 4:47:37 PM (5 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
wtf/posix/OSAllocatorPOSIX.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r286816 r286818 1 2021-12-09 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, reverting r286804. 4 5 Breaks internal builds. 6 7 Reverted changeset: 8 9 "Reduce maximum mmap size for Structure regions to help 10 placate ios" 11 https://bugs.webkit.org/show_bug.cgi?id=234091 12 https://commits.webkit.org/r286804 13 1 14 2021-12-09 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp
r286804 r286818 39 39 #define MAP_EXECUTABLE_FOR_JIT MAP_JIT 40 40 #define MAP_EXECUTABLE_FOR_JIT_WITH_JIT_CAGE MAP_JIT 41 #include <wtf/spi/cocoa/MachVMSPI.h>42 41 #else // OS(DARWIN) 43 42 #define MAP_EXECUTABLE_FOR_JIT 0 … … 75 74 } 76 75 76 77 // FIXME: Make a smarter version of this for Linux flavors that have aligned mmap. 77 78 void* OSAllocator::reserveUncommittedAligned(size_t bytes, Usage usage, bool writable, bool executable, bool jitCageEnabled, bool includesGuardPages) 78 79 { 79 80 ASSERT(hasOneBitSet(bytes) && bytes >= pageSize()); 80 81 #if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)82 UNUSED_PARAM(usage); // Not supported for mach API.83 ASSERT_UNUSED(includesGuardPages, !includesGuardPages);84 ASSERT_UNUSED(jitCageEnabled, !jitCageEnabled); // Not supported for mach API.85 vm_prot_t protections = VM_PROT_READ;86 if (writable)87 protections |= VM_PROT_WRITE;88 if (executable)89 protections |= VM_PROT_EXECUTE;90 91 const vm_inherit_t childProcessInheritance = VM_INHERIT_DEFAULT;92 93 void* aligned = nullptr;94 const bool copy = false;95 const int flags = VM_FLAGS_ANYWHERE;96 97 kern_return_t result = mach_vm_map(mach_task_self(), reinterpret_cast<mach_vm_address_t*>(&aligned), bytes, bytes - 1, flags, MEMORY_OBJECT_NULL, 0, copy, protections, protections, childProcessInheritance);98 RELEASE_ASSERT(result == KERN_SUCCESS, result, bytes);99 #if HAVE(MADV_FREE_REUSE)100 if (aligned) {101 // To support the "reserve then commit" model, we have to initially decommit.102 while (madvise(aligned, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }103 }104 #endif105 106 return aligned;107 #else108 81 // Double the size so we can ensure enough mapped memory to get an aligned start. 109 82 size_t mappedSize = bytes * 2; … … 123 96 124 97 return aligned; 125 #endif126 98 } 127 99
Note:
See TracChangeset
for help on using the changeset viewer.