20 #include "pedigree/kernel/process/MemoryPressureManager.h" 21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/utilities/Iterator.h" 23 #include "pedigree/kernel/utilities/utility.h" 27 MemoryPressureHandler::MemoryPressureHandler() =
default;
28 MemoryPressureHandler::~MemoryPressureHandler() =
default;
32 for (
size_t i = 0; i < MAX_MEMPRESSURE_PRIORITY; ++i)
35 it != m_Handlers[i].
end(); ++it)
37 NOTICE(
"Compact: " << (*it)->getMemoryPressureDescription());
40 NOTICE(
" -> pages released!");
43 NOTICE(
" -> no pages released.");
50 MemoryPressureManager::MemoryPressureManager() =
default;
51 MemoryPressureManager::~MemoryPressureManager() =
default;
56 if (prio >= MAX_MEMPRESSURE_PRIORITY)
57 prio = MAX_MEMPRESSURE_PRIORITY - 1;
64 for (
size_t i = 0; i < MAX_MEMPRESSURE_PRIORITY; ++i)
67 it != m_Handlers[i].
end();)
69 if ((*it) == pHandler)
71 it = m_Handlers[i].
erase(it);
void pushBack(const T &value)
Iterator erase(Iterator &Iter)
void removeHandler(MemoryPressureHandler *pHandler)
void registerHandler(size_t prio, MemoryPressureHandler *pHandler)