⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286818 in webkit


Ignore:
Timestamp:
Dec 9, 2021, 4:47:37 PM (5 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, reverting r286804.

Breaks internal builds.

Reverted changeset:

"Reduce maximum mmap size for Structure regions to help
placate ios"
https://bugs.webkit.org/show_bug.cgi?id=234091
https://commits.webkit.org/r286804

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r286816 r286818  
     12021-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
    1142021-12-09  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp

    r286804 r286818  
    3939#define MAP_EXECUTABLE_FOR_JIT MAP_JIT
    4040#define MAP_EXECUTABLE_FOR_JIT_WITH_JIT_CAGE MAP_JIT
    41 #include <wtf/spi/cocoa/MachVMSPI.h>
    4241#else // OS(DARWIN)
    4342#define MAP_EXECUTABLE_FOR_JIT 0
     
    7574}
    7675
     76
     77// FIXME: Make a smarter version of this for Linux flavors that have aligned mmap.
    7778void* OSAllocator::reserveUncommittedAligned(size_t bytes, Usage usage, bool writable, bool executable, bool jitCageEnabled, bool includesGuardPages)
    7879{
    7980    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 #endif
    105 
    106     return aligned;
    107 #else
    10881    // Double the size so we can ensure enough mapped memory to get an aligned start.
    10982    size_t mappedSize = bytes * 2;
     
    12396
    12497    return aligned;
    125 #endif
    12698}
    12799
Note: See TracChangeset for help on using the changeset viewer.