| Index: Source/wtf/PageAllocator.cpp
|
| diff --git a/Source/wtf/PageAllocator.cpp b/Source/wtf/PageAllocator.cpp
|
| index b9f3eae6a5c5bee8c75891eed51485995a55fc77..5f5eb440e4bfa5c87cc5b0ea2ee1093bc78a1d31 100644
|
| --- a/Source/wtf/PageAllocator.cpp
|
| +++ b/Source/wtf/PageAllocator.cpp
|
| @@ -221,5 +221,22 @@ void recommitSystemPages(void* addr, size_t len)
|
| #endif
|
| }
|
|
|
| +void discardSystemPages(void* addr, size_t len)
|
| +{
|
| + ASSERT(!(len & kSystemPageOffsetMask));
|
| +#if OS(POSIX)
|
| + // On POSIX, the implementation detail is that discard and decommit are the
|
| + // same, and lead to pages that are returned to the system immediately and
|
| + // get replaced with zeroed pages when touched. So we just call
|
| + // decommitSystemPages() here to avoid code duplication.
|
| + decommitSystemPages(addr, len);
|
| +#else
|
| + (void) addr;
|
| + (void) len;
|
| + // TODO(cevans): implement this using MEM_RESET for Windows, once we've
|
| + // decided that the semantics are a match.
|
| +#endif
|
| +}
|
| +
|
| } // namespace WTF
|
|
|
|
|