The Pedigree Project
0.1
|
#include <MemoryPressureManager.h>
Public Member Functions | |
bool | compact () |
void | registerHandler (size_t prio, MemoryPressureHandler *pHandler) |
void | removeHandler (MemoryPressureHandler *pHandler) |
Static Public Member Functions | |
static MemoryPressureManager & | instance () |
static size_t | getHighWatermark () |
static size_t | getLowWatermark () |
Private Attributes | |
List< MemoryPressureHandler * > | m_Handlers [MAX_MEMPRESSURE_PRIORITY] |
Static Private Attributes | |
static MemoryPressureManager | m_Instance |
MemoryPressureManager: global memory pressure handling.
This class offers a central interface for the various mechanisms available to alleviate memory pressure to register themselves and be called, without requiring the kernel itself to know about them (eg, loadable modules).
Definition at line 58 of file MemoryPressureManager.h.
bool MemoryPressureManager::compact | ( | ) |
Attempt to alleviate memory pressure by requesting registered handlers release pages that can be safely released.
Definition at line 30 of file MemoryPressureManager.cc.
References List< T, nodePoolSize >::end(), and NOTICE.
void MemoryPressureManager::registerHandler | ( | size_t | prio, |
MemoryPressureHandler * | pHandler | ||
) |
Register a new handler.
Definition at line 53 of file MemoryPressureManager.cc.
References List< T, nodePoolSize >::pushBack().
Referenced by MemoryPool::initialise(), and MemoryMapManager::MemoryMapManager().
void MemoryPressureManager::removeHandler | ( | MemoryPressureHandler * | pHandler | ) |
Remove a handler.
Definition at line 62 of file MemoryPressureManager.cc.
References List< T, nodePoolSize >::end(), and List< T, nodePoolSize >::erase().
Referenced by MemoryMapManager::MemoryMapManager().