The Pedigree Project 0.1
Public Member Functions | Private Attributes | List of all members
MemoryPoolPressureHandler Class Reference

#include <MemoryPool.h>

+ Inheritance diagram for MemoryPoolPressureHandler:
+ Collaboration diagram for MemoryPoolPressureHandler:

Public Member Functions

 MemoryPoolPressureHandler (MemoryPool *pool)
 
virtual const char * getMemoryPressureDescription ()
 
virtual bool compact ()
 

Private Attributes

MemoryPool * m_Pool
 

Detailed Description

MemoryPoolPressureHandler - handles removing unused pages from a MemoryPool when memory pressure is seen on the system. Because MemoryPools tend to be full of bursty allocations, it's fairly typical to get a couple pages free.

Definition at line 43 of file MemoryPool.h.

Constructor & Destructor Documentation

◆ MemoryPoolPressureHandler()

MemoryPoolPressureHandler::MemoryPoolPressureHandler ( MemoryPool *  pool)

Definition at line 56 of file MemoryPool.cc.

◆ ~MemoryPoolPressureHandler()

MemoryPoolPressureHandler::~MemoryPoolPressureHandler ( )
virtual

Definition at line 58 of file MemoryPool.cc.

Member Function Documentation

◆ compact()

bool MemoryPoolPressureHandler::compact ( )
virtual

Called by MemoryPressureManager to request this handler to take action to reduce memory pressure.

Returns
true if pages were released, false otherwise.

Implements MemoryPressureHandler.

Definition at line 64 of file MemoryPool.cc.

References MemoryPool::trim().

◆ getMemoryPressureDescription()

const char * MemoryPoolPressureHandler::getMemoryPressureDescription ( )
virtual

Returns static storage so describing a recovery action cannot itself allocate memory.

Implements MemoryPressureHandler.

Definition at line 60 of file MemoryPool.cc.

Member Data Documentation

◆ m_Pool

MemoryPool* MemoryPoolPressureHandler::m_Pool
private

Definition at line 53 of file MemoryPool.h.


The documentation for this class was generated from the following files: