// 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() {}
};
} // 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 {
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.