Chromium Code Reviews| Index: base/memory/discardable_shared_memory.h |
| diff --git a/base/memory/discardable_shared_memory.h b/base/memory/discardable_shared_memory.h |
| index 5dca884ca82e2d6665930905c92e990b8a5515c2..5720fad3e4755d25c8263c0785084fc4314053ac 100644 |
| --- a/base/memory/discardable_shared_memory.h |
| +++ b/base/memory/discardable_shared_memory.h |
| @@ -15,10 +15,13 @@ |
| #include <set> |
| #endif |
| -// Define DISCARDABLE_SHARED_MEMORY_SHRINKING if platform supports shrinking |
| -// of discardable shared memory segments. |
| -#if defined(OS_POSIX) && !defined(OS_ANDROID) |
| -#define DISCARDABLE_SHARED_MEMORY_SHRINKING |
| +// Define DISCARDABLE_SHARED_MEMORY_REMOVE if platform supports MADV_REMOVE |
| +// and the behavior of using madvise() to synchronsouly purge memory reliably |
| +// results in zero-filled-on-demand pages. madvise() will still be used on |
| +// other POSIX compatible platforms but doesn't provide the zero-filled pages |
| +// guarantee. |
| +#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_NACL) |
|
danakj
2015/10/21 18:34:25
Thanks for the extra comments, I'm finally wrappin
reveman
2015/10/21 19:28:53
Changed things a bit in latest patch, including a
|
| +#define DISCARDABLE_SHARED_MEMORY_REMOVE |
| #endif |
| namespace base { |
| @@ -124,12 +127,6 @@ class BASE_EXPORT DiscardableSharedMemory { |
| return shared_memory_.ShareToProcess(process_handle, new_handle); |
| } |
| -#if defined(DISCARDABLE_SHARED_MEMORY_SHRINKING) |
| - // Release as much memory as possible to the OS. The change in size will |
| - // be reflected by the return value of mapped_size(). |
| - void Shrink(); |
| -#endif |
| - |
| private: |
| // Virtual for tests. |
| virtual Time Now() const; |