+namespace internal {
+
+// This interface is used by the DiscardableMemoryManager class to provide some
+// level of userspace control over discardable memory allocations.
+class DiscardableMemoryManagerAllocation {
+ public:
+ // Allocate and acquire a lock that prevents the allocation from being purged
+ // by the system. Returns true if memory was previously allocated and is still
+ // resident.
+ virtual bool AllocateAndAcquireLock() = 0;
+
+ // Release a previously acquired lock on the allocation so that it can be
+ // purged by the system.
+ virtual void ReleaseLock() = 0;
+
+ // Explicitly purge this allocation. It is illegal to call this while a lock
+ // is acquired on the allocation.
+ virtual void Purge() = 0;
+
+ protected:
+ virtual ~DiscardableMemoryManagerAllocation() {}
+};
+
+} // namespace internal