|
CookMem 1.4.0
A C++ memory context / allocator
|
#include <logger.h>
Public Member Functions | |
| virtual void | logGetSegment (void *segment, std::size_t segmentSize)=0 |
| virtual void | logFreeSegment (void *segment, std::size_t segmentSize)=0 |
| virtual void | logTrimEmptySegments ()=0 |
| virtual void | logAllocation (void *userPtr, std::size_t userSize, MemAllocType_et allocType)=0 |
| virtual void | logReallocation (void *userPtr, std::size_t oldUserSize, std::size_t newUserSize)=0 |
| virtual void | logDeallocation (void *userPtr, std::size_t userSize)=0 |
| virtual void | logError (void *userPtr, MemError_et error, const char *file=__FILE__, int line=__LINE__)=0 |
A MemLogger logs memory allocation, deallocation, and errors.
This class here is merely used to define the functions needed to implement a MemLogger.
|
pure virtual |
Log the memory allocation.
| userPtr | the user pointer allocated. |
| userSize | the user requested size. |
| allocType | the type of the allocation. |
|
pure virtual |
Log the memory deallocation.
| userPtr | the user pointer allocated. |
| userSize | the user requested size. |
|
pure virtual |
Log the memory corruption.
| userPtr | the user pointer that had the memory corruption. |
| error | the type of the error encountered. |
| file | the source file where the error was detected. |
| line | the line number where the error was detected. |
|
pure virtual |
Log the memory segment release.
| segment | the segment released. |
| segmentSize | the segment size. |
|
pure virtual |
Log the memory segment allocation.
| segment | the segment obtained. |
| segmentSize | the segment size. |
|
pure virtual |
Log the memory reallocation. This is only called when the new size is smaller than the original size.
| userPtr | the user pointer allocated. |
| oldUserSize | the old user size. |
| newUserSize | the new user size. |
Log a pool empty-segment trimming pass.