Changeset 105918 in webkit


Ignore:
Timestamp:
Jan 25, 2012 12:52:41 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Implement OSAllocator::commit/decommit.
BlackBerry port should support virtual memory decommiting.
https://bugs.webkit.org/show_bug.cgi?id=77013

Patch by Yong Li <yoli@rim.com> on 2012-01-25
Reviewed by Rob Buis.

  • wtf/OSAllocatorPosix.cpp:

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

  • wtf/Platform.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r105905 r105918  
     12012-01-25  Yong Li  <yoli@rim.com>
     2
     3        [BlackBerry] Implement OSAllocator::commit/decommit.
     4        BlackBerry port should support virtual memory decommiting.
     5        https://bugs.webkit.org/show_bug.cgi?id=77013
     6
     7        Reviewed by Rob Buis.
     8
     9        * wtf/OSAllocatorPosix.cpp:
     10        (WTF::OSAllocator::reserveUncommitted):
     11        (WTF::OSAllocator::commit):
     12        (WTF::OSAllocator::decommit):
     13        * wtf/Platform.h:
     14
    1152012-01-24  Oliver Hunt  <oliver@apple.com>
    216
  • trunk/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp

    r100175 r105918  
    3838{
    3939    void* result = reserveAndCommit(bytes, usage, writable, executable, includesGuardPages);
    40 #if HAVE(MADV_FREE_REUSE)
     40#if OS(QNX)
     41    posix_madvise(result, bytes, POSIX_MADV_DONTNEED);
     42#elif HAVE(MADV_FREE_REUSE)
    4143    // To support the "reserve then commit" model, we have to initially decommit.
    4244    while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
     
    121123void OSAllocator::commit(void* address, size_t bytes, bool, bool)
    122124{
    123 #if HAVE(MADV_FREE_REUSE)
     125#if OS(QNX)
     126    posix_madvise(address, bytes, POSIX_MADV_WILLNEED);
     127#elif HAVE(MADV_FREE_REUSE)
    124128    while (madvise(address, bytes, MADV_FREE_REUSE) == -1 && errno == EAGAIN) { }
    125129#else
     
    132136void OSAllocator::decommit(void* address, size_t bytes)
    133137{
    134 #if HAVE(MADV_FREE_REUSE)
     138#if OS(QNX)
     139    posix_madvise(address, bytes, POSIX_MADV_DONTNEED);
     140#elif HAVE(MADV_FREE_REUSE)
    135141    while (madvise(address, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
    136142#elif HAVE(MADV_FREE)
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r105098 r105918  
    724724#define HAVE_ERRNO_H 1
    725725#define HAVE_MMAP 1
     726#define HAVE_MADV_FREE_REUSE 1
     727#define HAVE_MADV_FREE 1
    726728#define HAVE_SBRK 1
    727729#define HAVE_STRINGS_H 1
Note: See TracChangeset for help on using the changeset viewer.