Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / base / memory / discardable_memory_manager.h
index 94b3c55..8bf9289 100644 (file)
@@ -31,6 +31,10 @@ class DiscardableMemoryManagerAllocation {
   // is acquired on the allocation.
   virtual void Purge() = 0;
 
+  // Check if allocated memory is still resident. It is illegal to call this
+  // while a lock is acquired on the allocation.
+  virtual bool IsMemoryResident() const = 0;
+
  protected:
   virtual ~DiscardableMemoryManagerAllocation() {}
 };
@@ -38,18 +42,6 @@ class DiscardableMemoryManagerAllocation {
 }  // namespace internal
 }  // namespace base
 
-#if defined(COMPILER_GCC)
-namespace BASE_HASH_NAMESPACE {
-template <>
-struct hash<base::internal::DiscardableMemoryManagerAllocation*> {
-  size_t operator()(
-      base::internal::DiscardableMemoryManagerAllocation* ptr) const {
-    return hash<size_t>()(reinterpret_cast<size_t>(ptr));
-  }
-};
-}  // namespace BASE_HASH_NAMESPACE
-#endif  // COMPILER
-
 namespace base {
 namespace internal {
 
@@ -80,6 +72,9 @@ class BASE_EXPORT_PRIVATE DiscardableMemoryManager {
   void SetHardMemoryLimitExpirationTime(
       TimeDelta hard_memory_limit_expiration_time);
 
+  // This will make sure that all purged memory is released to the OS.
+  void ReleaseFreeMemory();
+
   // This will attempt to reduce memory footprint until within soft memory
   // limit. Returns true if there's no need to call this again until allocations
   // have been used.