From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- .../nel/classNLMEMORY_1_1CHeapAllocator.html | 3848 ++++++++++++++++++++ 1 file changed, 3848 insertions(+) create mode 100644 docs/doxygen/nel/classNLMEMORY_1_1CHeapAllocator.html (limited to 'docs/doxygen/nel/classNLMEMORY_1_1CHeapAllocator.html') diff --git a/docs/doxygen/nel/classNLMEMORY_1_1CHeapAllocator.html b/docs/doxygen/nel/classNLMEMORY_1_1CHeapAllocator.html new file mode 100644 index 00000000..91d1d6a8 --- /dev/null +++ b/docs/doxygen/nel/classNLMEMORY_1_1CHeapAllocator.html @@ -0,0 +1,3848 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# Home   # nevrax.com   
+ + + + +
Nevrax
+ + + + + + + + + + +
+ + +
+ Nevrax.org
+ + + + + + + +
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
+
+ + +
+ + +
+Docs + +
+  + + + + + +
Documentation 
+ +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  
+

NLMEMORY::CHeapAllocator Class Reference

#include <heap_allocator.h> +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

enum  TBlockAllocationMode { Grow, +DontGrow + }
 Block allocation mode. More...

enum  TOutOfMemoryMode { ThrowException, +ReturnNull + }
 Out of memory signal. More...

enum  {
+  SmallBlockGranularityShift = 3, +SmallBlockGranularity = 1<<SmallBlockGranularityShift, +FirstSmallBlock = 8, +LastSmallBlock = 128, +
+  SmallBlockPoolSize = 20 +
+ }

Public Methods

 CHeapAllocator (uint mainBlockSize=1024 *1024 *10, uint blockCount=1, TBlockAllocationMode blockAllocationMode=Grow, TOutOfMemoryMode outOfMemoryMode=ThrowException)
 Constructor / Destructor. More...

 ~CHeapAllocator ()
 Destruction. More...

void free (void *ptr)
 Free a pointer. More...

void freeAll ()
 Free all the block allocated. More...

void releaseMemory ()
bool setMainBlockSize (uint mainBlockSize)
 Returns false if the block size choosed i too big (>= 1 Go). More...

uint getMainBlockSize () const
 Get the size of the block. More...

bool setMainBlockCount (uint blockCount)
 Set the block count. More...

uint getMainBlockCount () const
 Get the block count. More...

void setBlockAllocationMode (TBlockAllocationMode mode)
TBlockAllocationMode getBlockAllocationMode () const
void setOutOfMemoryMode (TOutOfMemoryMode mode)
TOutOfMemoryMode getOutOfMemoryMode () const
bool checkHeap (bool stopOnError) const
uint getAllocatedMemory () const
uint getFreeMemory () const
uint getTotalMemoryUsed () const
uint getSmallBlockMemory () const
uint getAllocatedSystemMemoryByAllocator ()
float getFragmentationRatio () const
void setName (const char *name)
const char * getName () const
uint debugGetDebugInfoSize () const
uint debugGetSBDebugInfoSize () const
uint debugGetLBDebugInfoSize () const
uint debugGetAllocatedMemoryByCategory (const char *category) const
bool debugStatisticsReport (const char *stateFile, bool memoryMap)
void debugAlwaysCheckMemory (bool alwaysCheck)
bool debugIsAlwaysCheckMemory (bool alwaysCheck) const
void debugReportMemoryLeak ()
virtual uint8allocateBlock (uint size)
 Method used to allocate system memory. More...

virtual void freeBlock (uint8 *block)
 Method used to free system memory. More...

void * allocate (uint size, const char *sourceFile, uint line, const char *category)
void * reallocate (void *ptr, uint size, const char *sourceFile, uint line, const char *category)
void debugPushCategoryString (const char *str)
void debugPopCategoryString ()

Static Public Methods

uint getBlockSize (void *block)
 Get a block size with its pointer. More...

uint getAllocatedSystemMemory ()

Private Types

typedef char TCategoryString [CategoryStringLength]
enum  {
+  ReleaseHeaderSize = 8, +CategoryStringLength = 8, +BeginNodeMarkers = '<', +EndNodeMarkers = '>', +
+  UnallocatedMemory = 0xba, +UninitializedMemory = 0xbc, +DeletedMemory = 0xbd, +NameLength = 32 +
+ }
enum  { FreeNodeBlockSize = 128, +FreeNodeBlockSizeShift = 7, +FreeNodeBlockSizeMask = 0x7f + }
enum  { Align = 8, +BlockDataSizeMin = 1<<4 + }
enum  { UserDataBlockSizeMin = sizeof(CFreeNode) + }

Private Methods

bool checkNodeLB (const CMainBlock *mainBlock, const CNodeBegin *previous, const CNodeBegin *current, const CNodeBegin *next, bool stopOnError) const
void rotateLeft (CFreeNode *x)
void rotateRight (CFreeNode *x)
void insert (CFreeNode *x)
void erase (CFreeNode *z)
CFreeNodefind (uint size)
CNodeBeginsplitNode (CNodeBegin *node, uint newSize)
void initEmptyBlock (CMainBlock &mainBlock)
bool checkFreeNode (const CFreeNode *current, bool stopOnError, bool recurse) const
void checkNode (const CNodeBegin *current, uint32 crc) const
bool internalCheckHeap (bool stopOnError) const
void enterCriticalSection () const
void leaveCriticalSection () const
void enterCriticalSectionSB () const
void leaveCriticalSectionSB () const
void enterCriticalSectionLB () const
void leaveCriticalSectionLB () const
bool checkNodeSB (const CSmallBlockPool *mainBlock, const CNodeBegin *previous, const CNodeBegin *current, const CNodeBegin *next, bool stopOnError) const

Static Private Methods

uint32 evalMagicNumber (const CNodeBegin *node)
const CNodeBegingetNextNode (const CNodeBegin *current)
CNodeBegingetNextNode (CNodeBegin *current)
const CFreeNodegetFreeNode (const CNodeBegin *current)
CFreeNodegetFreeNode (CNodeBegin *current)
const CNodeBegingetNode (const CFreeNode *current)
CNodeBegingetNode (CFreeNode *current)
uint getNodeSize (const CNodeBegin *current)
bool isNodeFree (const CNodeBegin *current)
bool isNodeUsed (const CNodeBegin *current)
bool isNodeLast (const CNodeBegin *current)
bool isNodeSmall (const CNodeBegin *current)
bool isNodeRed (const CFreeNode *current)
bool isNodeBlack (const CFreeNode *current)
void setNodeFree (CNodeBegin *current)
void setNodeUsed (CNodeBegin *current)
void setNodeLast (CNodeBegin *current, bool last)
void setNodeSize (CNodeBegin *current, uint size)
void setNodeColor (CFreeNode *current, bool red)
void setNodeRed (CFreeNode *current)
void setNodeBlack (CFreeNode *current)
const CNodeBegingetFirstNode (const CMainBlock *mainBlock)
CNodeBegingetFirstNode (CMainBlock *mainBlock)
void mergeNode (CNodeBegin *node)
void computeCRC32 (uint32 &crc, const void *buffer, unsigned int count)
CNodeBegingetSmallBlock (CSmallBlockPool *smallBlock, uint blockIndex)
CNodeBegingetNextSmallBlock (CNodeBegin *previous)
void setNextSmallBlock (CNodeBegin *previous, CNodeBegin *next)

Private Attributes

uint _MainBlockSize
uint _BlockCount
TBlockAllocationMode _BlockAllocationMode
TOutOfMemoryMode _OutOfMemoryMode
bool _AlwaysCheck
CMainBlock_MainBlockList
CFreeNode_FreeTreeRoot
CNullNode _NullNode
CMemoryMutex _MutexLB
char _Name [NameLength]
uint32 _AllocateCount
volatile CNodeBegin_FreeSmallBlocks [NL_SMALLBLOCK_COUNT]
volatile CSmallBlockPool_SmallBlockPool
CMemoryMutex _MutexSB
CMemoryTDS _CategoryStack

Friends

struct CNodeBegin
+


Member Typedef Documentation

+

+ + + + +
+ + +
typedef char NLMEMORY::CHeapAllocator::TCategoryString[CategoryStringLength] [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 214 of file src/memory/heap_allocator.h.

+


Member Enumeration Documentation

+

+ + + + +
+ + +
anonymous enum [private] +
+
+ + + + + +
+   + + +

+

+Enumeration values:
+ + + + + + + + + +
ReleaseHeaderSize  +
CategoryStringLength  +
BeginNodeMarkers  +
EndNodeMarkers  +
UnallocatedMemory  +
UninitializedMemory  +
DeletedMemory  +
NameLength  +
+
+ +

+Definition at line 202 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
anonymous enum [private] +
+
+ + + + + +
+   + + +

+

+Enumeration values:
+ + + + +
FreeNodeBlockSize  +
FreeNodeBlockSizeShift  +
FreeNodeBlockSizeMask  +
+
+ +

+Definition at line 247 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
anonymous enum [private] +
+
+ + + + + +
+   + + +

+

+Enumeration values:
+ + + +
Align  +
BlockDataSizeMin  +
+
+ +

+Definition at line 255 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
anonymous enum [private] +
+
+ + + + + +
+   + + +

+

+Enumeration values:
+ + +
UserDataBlockSizeMin  +
+
+ +

+Definition at line 373 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
anonymous enum +
+
+ + + + + +
+   + + +

+

+Enumeration values:
+ + + + + + +
SmallBlockGranularityShift  +
SmallBlockGranularity  +
FirstSmallBlock  +
LastSmallBlock  +
SmallBlockPoolSize  +
+
+ +

+Definition at line 446 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
enum NLMEMORY::CHeapAllocator::TBlockAllocationMode +
+
+ + + + + +
+   + + +

+Block allocation mode. +

+

+Enumeration values:
+ + + +
Grow  +When the allocator runs out of memory, allocate a new block.
DontGrow  +When the allocator runs out of memory, returns a out of memory signal.
+
+ +

+Definition at line 72 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
enum NLMEMORY::CHeapAllocator::TOutOfMemoryMode +
+
+ + + + + +
+   + + +

+Out of memory signal. +

+

+Enumeration values:
+ + + +
ThrowException  +When the allocator runs out of memory, throw an exception.
ReturnNull  +When the allocator runs out of memory, returns NULL.
+
+ +

+Definition at line 84 of file src/memory/heap_allocator.h.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NLMEMORY::CHeapAllocator::CHeapAllocator uint   mainBlockSize = 1024 *1024 *10,
uint   blockCount = 1,
TBlockAllocationMode   blockAllocationMode = Grow,
TOutOfMemoryMode   outOfMemoryMode = ThrowException
+
+ + + + + +
+   + + +

+Constructor / Destructor. +

+ +

+Definition at line 953 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
NLMEMORY::CHeapAllocator::~CHeapAllocator  
+
+ + + + + +
+   + + +

+Destruction. +

+ +

+Definition at line 1011 of file memory/heap_allocator.cpp. +

+References CNodeBegin, and evalMagicNumber.

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void * NLMEMORY::CHeapAllocator::allocate uint   size,
const char *   sourceFile,
uint   line,
const char *   category
+
+ + + + + +
+   + + +

+ +

+Definition at line 1526 of file memory/heap_allocator.cpp. +

+References file.

+

+ + + + +
+ + + + + + + + + + +
uint8 * NLMEMORY::CHeapAllocator::allocateBlock uint   size [virtual]
+
+ + + + + +
+   + + +

+Method used to allocate system memory. +

+ +

+Definition at line 2999 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::checkFreeNode const CFreeNode  current,
bool   stopOnError,
bool   recurse
const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 644 of file memory/heap_allocator.cpp. +

+References NL_HEAP_UNKNOWN_CATEGORY.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::checkHeap bool   stopOnError const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2990 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMEMORY::CHeapAllocator::checkNode const CNodeBegin  current,
uint32   crc
const [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 3154 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::checkNodeLB const CMainBlock  mainBlock,
const CNodeBegin  previous,
const CNodeBegin  current,
const CNodeBegin  next,
bool   stopOnError
const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 544 of file memory/heap_allocator.cpp. +

+References CNodeBegin, DeletedMemory, getNodeSize, and isNodeLast. +

+Referenced by debugGetAllocatedMemoryByCategory.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::checkNodeSB const CSmallBlockPool  mainBlock,
const CNodeBegin  previous,
const CNodeBegin  current,
const CNodeBegin  next,
bool   stopOnError
const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 478 of file memory/heap_allocator.cpp. +

+References CategoryStringLength, CNodeBegin, and EndNodeMarkers. +

+Referenced by debugGetAllocatedMemoryByCategory.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void NLMEMORY::CHeapAllocator::computeCRC32 uint32  crc,
const void *   buffer,
unsigned int   count
[inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 344 of file memory/heap_allocator.cpp. +

+References isNodeBlack, isNodeRed, NL_UPDATE_MAGIC_NUMBER_FREE_NODE, rotateLeft, rotateRight, setNodeBlack, setNodeColor, setNodeRed, w, and x.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::debugAlwaysCheckMemory bool   alwaysCheck
+
+ + + + + +
+   + + +

+ +

+Definition at line 3083 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
uint NLMEMORY::CHeapAllocator::debugGetAllocatedMemoryByCategory const char *   category const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2122 of file memory/heap_allocator.cpp. +

+References _MainBlockList, _SmallBlockPool, checkNodeLB, checkNodeSB, CNodeBegin, enterCriticalSection, getFirstNode, getNextNode, getSmallBlock, internalAssert, and SmallBlockPoolSize.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::debugGetDebugInfoSize   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2181 of file memory/heap_allocator.cpp. +

+References _FreeTreeRoot. +

+Referenced by getBlockSize.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::debugGetLBDebugInfoSize   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2187 of file memory/heap_allocator.cpp. +

+Referenced by getBlockSize.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::debugGetSBDebugInfoSize   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2219 of file memory/heap_allocator.cpp. +

+References _CategoryStack, NelAlloc, and NL_HEAP_CATEGORY_BLOCK_CATEGORY. +

+Referenced by getBlockSize.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::debugIsAlwaysCheckMemory bool   alwaysCheck const
+
+ + + + + +
+   + + +

+ +

+Definition at line 3092 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::debugPopCategoryString  
+
+ + + + + +
+   + + +

+ +

+Definition at line 3129 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::debugPushCategoryString const char *   str
+
+ + + + + +
+   + + +

+ +

+Definition at line 3113 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::debugReportMemoryLeak  
+
+ + + + + +
+   + + +

+ +

+Definition at line 2854 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::debugStatisticsReport const char *   stateFile,
bool   memoryMap
+
+ + + + + +
+   + + +

+ +

+Definition at line 2291 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::enterCriticalSection   const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 775 of file memory/heap_allocator.cpp. +

+Referenced by debugGetAllocatedMemoryByCategory.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::enterCriticalSectionLB   const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 761 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::enterCriticalSectionSB   const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 747 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::erase CFreeNode  z [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1142 of file memory/heap_allocator.cpp. +

+References evalMagicNumber, and getFreeNode.

+

+ + + + +
+ + + + + + + + + + +
uint32 NLMEMORY::CHeapAllocator::evalMagicNumber const CNodeBegin  node [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 457 of file memory/heap_allocator.cpp. +

+References BeginNodeMarkers, CNodeBegin, getNodeSize, and isNodeLast. +

+Referenced by erase, and ~CHeapAllocator.

+

+ + + + +
+ + + + + + + + + + +
CHeapAllocator::CFreeNode * NLMEMORY::CHeapAllocator::find uint   size [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 314 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::free void *   ptr
+
+ + + + + +
+   + + +

+Free a pointer. +

+ +

+Definition at line 1871 of file memory/heap_allocator.cpp. +

+References CNodeBegin, and getFreeNode.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::freeAll  
+
+ + + + + +
+   + + +

+Free all the block allocated. +

+ +

+Definition at line 2747 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::freeBlock uint8  block [virtual]
+
+ + + + + +
+   + + +

+Method used to free system memory. +

+ +

+Definition at line 3007 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getAllocatedMemory   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2061 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getAllocatedSystemMemory   [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 3191 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getAllocatedSystemMemoryByAllocator  
+
+ + + + + +
+   + + +

+ +

+Definition at line 3240 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
CHeapAllocator::TBlockAllocationMode NLMEMORY::CHeapAllocator::getBlockAllocationMode   const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 875 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getBlockSize void *   block [static]
+
+ + + + + +
+   + + +

+Get a block size with its pointer. +

+ +

+Definition at line 1513 of file memory/heap_allocator.cpp. +

+References debugGetDebugInfoSize, debugGetLBDebugInfoSize, debugGetSBDebugInfoSize, and file.

+

+ + + + +
+ + + + + + + + + + +
CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getFirstNode CMainBlock  mainBlock [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 388 of file memory/heap_allocator.cpp. +

+References w, and x.

+

+ + + + +
+ + + + + + + + + + +
const CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getFirstNode const CMainBlock  mainBlock [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 380 of file memory/heap_allocator.cpp. +

+References _FreeTreeRoot, and x. +

+Referenced by debugGetAllocatedMemoryByCategory.

+

+ + + + +
+ + + + + + + + + +
float NLMEMORY::CHeapAllocator::getFragmentationRatio   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2706 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getFreeMemory   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2587 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
CHeapAllocator::CFreeNode * NLMEMORY::CHeapAllocator::getFreeNode CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 427 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
const CHeapAllocator::CFreeNode * NLMEMORY::CHeapAllocator::getFreeNode const CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 420 of file memory/heap_allocator.cpp. +

+References _FreeTreeRoot, and x. +

+Referenced by erase, and free.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getMainBlockCount   const [inline]
+
+ + + + + +
+   + + +

+Get the block count. +

+ +

+Definition at line 812 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getMainBlockSize   const [inline]
+
+ + + + + +
+   + + +

+Get the size of the block. +

+ +

+Definition at line 890 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
const char * NLMEMORY::CHeapAllocator::getName   const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 883 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getNextNode CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 408 of file memory/heap_allocator.cpp. +

+References w, and x.

+

+ + + + +
+ + + + + + + + + + +
const CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getNextNode const CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 396 of file memory/heap_allocator.cpp. +

+References NL_UPDATE_MAGIC_NUMBER_FREE_NODE, setNodeRed, w, and x. +

+Referenced by debugGetAllocatedMemoryByCategory.

+

+ + + + +
+ + + + + + + + + + +
CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getNextSmallBlock CNodeBegin  previous [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 907 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getNode CFreeNode  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 441 of file memory/heap_allocator.cpp. +

+References UserDataBlockSizeMin.

+

+ + + + +
+ + + + + + + + + + +
const CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getNode const CFreeNode  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 434 of file memory/heap_allocator.cpp. +

+References Align, getNodeSize, and internalAssert. +

+Referenced by isNodeBlack, and isNodeSmall.

+

+ + + + +
+ + + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getNodeSize const CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 448 of file memory/heap_allocator.cpp. +

+References CNodeBegin, and UserDataBlockSizeMin. +

+Referenced by checkNodeLB, evalMagicNumber, getNode, isNodeBlack, and isNodeSmall.

+

+ + + + +
+ + + + + + + + + +
CHeapAllocator::TOutOfMemoryMode NLMEMORY::CHeapAllocator::getOutOfMemoryMode   const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 857 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::getSmallBlock CSmallBlockPool  smallBlock,
uint   blockIndex
[inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 900 of file memory/heap_allocator.cpp. +

+Referenced by debugGetAllocatedMemoryByCategory.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getSmallBlockMemory   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2679 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
uint NLMEMORY::CHeapAllocator::getTotalMemoryUsed   const
+
+ + + + + +
+   + + +

+ +

+Definition at line 2650 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::initEmptyBlock CMainBlock  mainBlock [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1458 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::insert CFreeNode  x [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1019 of file memory/heap_allocator.cpp. +

+References CNodeBegin, and LastSmallBlock.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::internalCheckHeap bool   stopOnError const [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 3014 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::isNodeBlack const CFreeNode  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 149 of file memory/heap_allocator.cpp. +

+References getNode, getNodeSize, NL_UPDATE_MAGIC_NUMBER_FREE_NODE, and x. +

+Referenced by computeCRC32.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::isNodeFree const CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 110 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::isNodeLast const CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 124 of file memory/heap_allocator.cpp. +

+Referenced by checkNodeLB, and evalMagicNumber.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::isNodeRed const CFreeNode  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 142 of file memory/heap_allocator.cpp. +

+References _NullNode, and x. +

+Referenced by computeCRC32, setNodeBlack, and setNodeLast.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::isNodeSmall const CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 131 of file memory/heap_allocator.cpp. +

+References _FreeTreeRoot, _NullNode, getNode, getNodeSize, NLMEMORY::CHeapAllocator::CFreeNode::Left, NLMEMORY::CHeapAllocator::CFreeNode::Right, and x.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::isNodeUsed const CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 117 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::leaveCriticalSection   const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 783 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::leaveCriticalSectionLB   const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 768 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::leaveCriticalSectionSB   const [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 754 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::mergeNode CNodeBegin  node [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1409 of file memory/heap_allocator.cpp. +

+References _SmallBlockPool, CNodeBegin, file, and SmallBlockPoolSize.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void* NLMEMORY::CHeapAllocator::reallocate void *   ptr,
uint   size,
const char *   sourceFile,
uint   line,
const char *   category
+
+ + + + + +
+   + + +

+

+

+ + + + +
+ + + + + + + + + +
void NLMEMORY::CHeapAllocator::releaseMemory  
+
+ + + + + +
+   + + +

+

+Todo:
+ Free all the block allocated and release all the memory used by the allocator
+

+Definition at line 2781 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::rotateLeft CFreeNode  x [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 218 of file memory/heap_allocator.cpp. +

+References x, and y. +

+Referenced by computeCRC32, and setNodeColor.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::rotateRight CFreeNode  x [inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 264 of file memory/heap_allocator.cpp. +

+References _NullNode, and y. +

+Referenced by computeCRC32.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setBlockAllocationMode TBlockAllocationMode   mode [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 864 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::setMainBlockCount uint   blockCount
+
+ + + + + +
+   + + +

+Set the block count. +

+

+

+ + + + +
+ + + + + + + + + + +
bool NLMEMORY::CHeapAllocator::setMainBlockSize uint   mainBlockSize
+
+ + + + + +
+   + + +

+Returns false if the block size choosed i too big (>= 1 Go). +

+

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setName const char *   name
+
+ + + + + +
+   + + +

+ +

+Definition at line 3100 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNextSmallBlock CNodeBegin  previous,
CNodeBegin  next
[inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 914 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNodeBlack CFreeNode  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 209 of file memory/heap_allocator.cpp. +

+References isNodeRed, setNodeRed, x, and y. +

+Referenced by computeCRC32, and setNodeLast.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNodeColor CFreeNode  current,
bool   red
[inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 192 of file memory/heap_allocator.cpp. +

+References rotateLeft, and x. +

+Referenced by computeCRC32.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNodeFree CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 156 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNodeLast CNodeBegin  current,
bool   last
[inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 170 of file memory/heap_allocator.cpp. +

+References isNodeRed, setNodeBlack, setNodeRed, x, and y.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNodeRed CFreeNode  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 202 of file memory/heap_allocator.cpp. +

+References x. +

+Referenced by computeCRC32, getNextNode, setNodeBlack, and setNodeLast.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNodeSize CNodeBegin  current,
uint   size
[inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 180 of file memory/heap_allocator.cpp. +

+References x, and y.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setNodeUsed CNodeBegin  current [inline, static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 163 of file memory/heap_allocator.cpp. +

+References _FreeTreeRoot, and x.

+

+ + + + +
+ + + + + + + + + + +
void NLMEMORY::CHeapAllocator::setOutOfMemoryMode TOutOfMemoryMode   mode [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 846 of file memory/heap_allocator.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
CHeapAllocator::CNodeBegin * NLMEMORY::CHeapAllocator::splitNode CNodeBegin  node,
uint   newSize
[inline, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1324 of file memory/heap_allocator.cpp.

+


Friends And Related Function Documentation

+

+ + + + +
+ + +
friend struct CNodeBegin [friend] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 268 of file src/memory/heap_allocator.h. +

+Referenced by checkNodeLB, checkNodeSB, debugGetAllocatedMemoryByCategory, evalMagicNumber, free, getNodeSize, insert, mergeNode, and ~CHeapAllocator.

+


Member Data Documentation

+

+ + + + +
+ + +
uint32 NLMEMORY::CHeapAllocator::_AllocateCount [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 436 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
bool NLMEMORY::CHeapAllocator::_AlwaysCheck [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 423 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
TBlockAllocationMode NLMEMORY::CHeapAllocator::_BlockAllocationMode [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 420 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
uint NLMEMORY::CHeapAllocator::_BlockCount [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 419 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
CMemoryTDS NLMEMORY::CHeapAllocator::_CategoryStack [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 522 of file src/memory/heap_allocator.h. +

+Referenced by debugGetSBDebugInfoSize.

+

+ + + + +
+ + +
volatile CNodeBegin* NLMEMORY::CHeapAllocator::_FreeSmallBlocks[NL_SMALLBLOCK_COUNT] [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 495 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
CFreeNode* NLMEMORY::CHeapAllocator::_FreeTreeRoot [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 430 of file src/memory/heap_allocator.h. +

+Referenced by debugGetDebugInfoSize, getFirstNode, getFreeNode, isNodeSmall, and setNodeUsed.

+

+ + + + +
+ + +
CMainBlock* NLMEMORY::CHeapAllocator::_MainBlockList [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 427 of file src/memory/heap_allocator.h. +

+Referenced by debugGetAllocatedMemoryByCategory.

+

+ + + + +
+ + +
uint NLMEMORY::CHeapAllocator::_MainBlockSize [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 418 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
CMemoryMutex NLMEMORY::CHeapAllocator::_MutexLB [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 432 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
CMemoryMutex NLMEMORY::CHeapAllocator::_MutexSB [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 498 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
char NLMEMORY::CHeapAllocator::_Name[NameLength] [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 434 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
CNullNode NLMEMORY::CHeapAllocator::_NullNode [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 431 of file src/memory/heap_allocator.h. +

+Referenced by isNodeRed, isNodeSmall, and rotateRight.

+

+ + + + +
+ + +
TOutOfMemoryMode NLMEMORY::CHeapAllocator::_OutOfMemoryMode [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 421 of file src/memory/heap_allocator.h.

+

+ + + + +
+ + +
volatile CSmallBlockPool* NLMEMORY::CHeapAllocator::_SmallBlockPool [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 496 of file src/memory/heap_allocator.h. +

+Referenced by debugGetAllocatedMemoryByCategory, and mergeNode.

+


The documentation for this class was generated from the following files: + + + +
                                                                                                                                                                    +
+ + -- cgit v1.2.1