Changeset 184245 in webkit


Ignore:
Timestamp:
May 12, 2015, 9:02:09 PM (10 years ago)
Author:
msaboff@apple.com
Message:

If JSC cannot get executable memory, it shouldn't call madvise
https://bugs.webkit.org/show_bug.cgi?id=144931

Reviewed by Mark Lam.

Made calling madvise conditional on really getting mmapped memory.

  • wtf/OSAllocatorPosix.cpp:

(WTF::OSAllocator::reserveUncommitted):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r184137 r184245  
     12015-05-12  Michael Saboff  <msaboff@apple.com>
     2
     3        If JSC cannot get executable memory, it shouldn't call madvise
     4        https://bugs.webkit.org/show_bug.cgi?id=144931
     5
     6        Reviewed by Mark Lam.
     7
     8        Made calling madvise conditional on really getting mmapped memory.
     9
     10        * wtf/OSAllocatorPosix.cpp:
     11        (WTF::OSAllocator::reserveUncommitted):
     12
    1132015-05-11  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/Source/WTF/wtf/OSAllocatorPosix.cpp

    r170147 r184245  
    5151    void* result = reserveAndCommit(bytes, usage, writable, executable, includesGuardPages);
    5252#if HAVE(MADV_FREE_REUSE)
    53     // To support the "reserve then commit" model, we have to initially decommit.
    54     while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
     53    if (result) {
     54        // To support the "reserve then commit" model, we have to initially decommit.
     55        while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
     56    }
    5557#endif
    5658
Note: See TracChangeset for help on using the changeset viewer.