Changeset 242916 in webkit


Ignore:
Timestamp:
Mar 13, 2019 4:07:06 PM (5 years ago)
Author:
yoshiaki.jitsukawa@sony.com
Message:

[bmalloc] Use MADV_FREE on FreeBSD
https://bugs.webkit.org/show_bug.cgi?id=195665

Reviewed by Geoffrey Garen.

  • bmalloc/BPlatform.h:

Introduce BOS_FREEBSD, which is equivalent to WTF_OS_FREEBSD

  • bmalloc/VMAllocate.h:

(bmalloc::vmDeallocatePhysicalPages):

Use MADV_FREE instead of MADV_DONTNEED if BOS(FREEBSD), since on FreeBSD,
unlike on Linux, MADV_DONTNEED doesn't let the OS discard the contents of
the pages.

Location:
trunk/Source/bmalloc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r242892 r242916  
     12019-03-13  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
     2
     3        [bmalloc] Use MADV_FREE on FreeBSD
     4        https://bugs.webkit.org/show_bug.cgi?id=195665
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * bmalloc/BPlatform.h:
     9
     10        Introduce BOS_FREEBSD, which is equivalent to WTF_OS_FREEBSD
     11
     12        * bmalloc/VMAllocate.h:
     13        (bmalloc::vmDeallocatePhysicalPages):
     14
     15        Use MADV_FREE instead of MADV_DONTNEED if BOS(FREEBSD), since on FreeBSD,
     16        unlike on Linux, MADV_DONTNEED doesn't let the OS discard the contents of
     17        the pages.
     18
    1192019-03-13  Sam Weinig  <sam@webkit.org>
    220
  • trunk/Source/bmalloc/bmalloc/BPlatform.h

    r237399 r242916  
    4949#endif
    5050
     51#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
     52#define BOS_FREEBSD 1
     53#endif
     54
    5155#if defined(WIN32) || defined(_WIN32)
    5256#define BOS_WINDOWS 1
  • trunk/Source/bmalloc/bmalloc/VMAllocate.h

    r240043 r242916  
    202202#if BOS(DARWIN)
    203203    SYSCALL(madvise(p, vmSize, MADV_FREE_REUSABLE));
     204#elif BOS(FREEBSD)
     205    SYSCALL(madvise(p, vmSize, MADV_FREE));
    204206#else
    205207    SYSCALL(madvise(p, vmSize, MADV_DONTNEED));
Note: See TracChangeset for help on using the changeset viewer.