Index: base/memory/discardable_shared_memory.h |
diff --git a/base/memory/discardable_shared_memory.h b/base/memory/discardable_shared_memory.h |
index e3b437c89e7e4bb743db4dc1c7d82ed411a1cb40..486d827e7ee7a90330dd4d4184b07b67fb12a732 100644 |
--- a/base/memory/discardable_shared_memory.h |
+++ b/base/memory/discardable_shared_memory.h |
@@ -34,6 +34,9 @@ class BASE_EXPORT DiscardableSharedMemory { |
// Closes any open files. |
virtual ~DiscardableSharedMemory(); |
+ // Return true iff shrinking of discardable shared memory is supported. |
+ static bool IsShrinkingSupported(); |
+ |
// Creates and maps a locked DiscardableSharedMemory object with |size|. |
// Returns true on success and false on failure. |
bool CreateAndMap(size_t size); |
@@ -93,11 +96,10 @@ class BASE_EXPORT DiscardableSharedMemory { |
// each call. |
bool Purge(Time current_time); |
- // Purge and release as much memory as possible to the OS. |
- // Note: The amount of memory that can be released to the OS is platform |
- // specific. Best case, all but one page is released. Worst case, nothing |
- // is released. |
- bool PurgeAndTruncate(Time current_time); |
+ // Release as much memory as possible to the OS. The change in size will |
+ // be reflected by the return value of mapped_size(). |
+ // Note: It is an error to call this if IsShrinkingSupported() returns false. |
+ void Shrink(); |
// Returns true if memory is still resident. |
bool IsMemoryResident() const; |