Changeset 128818 in webkit


Ignore:
Timestamp:
Sep 17, 2012 4:00:32 PM (12 years ago)
Author:
Csaba Osztrogonác
Message:

Unreviewed, rolling out r128796.
http://trac.webkit.org/changeset/128796
https://bugs.webkit.org/show_bug.cgi?id=96966

It broke everything (Requested by Ossy_NIGHT on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-17

  • wtf/OSAllocatorPosix.cpp:

(WTF::OSAllocator::reserveUncommitted):
(WTF::OSAllocator::reserveAndCommit):
(WTF::OSAllocator::commit):
(WTF::OSAllocator::decommit):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r128796 r128818  
     12012-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
    1152012-09-17  Uli Schlachter  <psychon@znc.in>
    216
  • trunk/Source/WTF/wtf/OSAllocatorPosix.cpp

    r128796 r128818  
    4242    if (result == MAP_FAILED)
    4343        CRASH();
    44 #elif 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)
    4848    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)
    5250    // To support the "reserve then commit" model, we have to initially decommit.
    5351    while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
     
    7270    if (executable)
    7371        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;
    7484#endif
    7585
     
    132142        CRASH();
    133143#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);
    141146    madvise(address, bytes, MADV_WILLNEED);
    142147#elif HAVE(MADV_FREE_REUSE)
     
    160165#elif OS(LINUX)
    161166    madvise(address, bytes, MADV_DONTNEED);
    162     if (!mprotect(address, bytes, PROT_NONE))
    163         CRASH();
    164167#elif HAVE(MADV_FREE_REUSE)
    165168    while (madvise(address, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
Note: See TracChangeset for help on using the changeset viewer.