heap_allocator.h File Reference

#include "memory_common.h"
#include "memory_mutex.h"
#include "memory_tds.h"

Go to the source code of this file.

Namespaces

namespace  NLMEMORY

Macros

#define NelAlloc(heap, size, category)   ((heap).allocate (size, __FILE__, __LINE__, category))
#define NelRealloc(heap, size, ptr, category)   (heap.reallocate (ptr, size, __FILE__, __LINE__, category))

Small Block

#define NL_ALIGN_SIZE_FOR_SMALLBLOCK(size)   (((size) + SmallBlockGranularity-1) & ~(SmallBlockGranularity-1))
#define NL_SIZE_TO_SMALLBLOCK_INDEX(size)   ((size-1)>>SmallBlockGranularityShift)
#define NL_SMALLBLOCK_COUNT   (1+(LastSmallBlock - FirstSmallBlock)/SmallBlockGranularity)

Implementation

#define NL_HEAP_NODE_END_SIZE   sizeof(CNodeEnd)


Define Documentation

#define NelAlloc heap,
size,
category   )     ((heap).allocate (size, __FILE__, __LINE__, category))
 

NelAlloc: category can be NULL. Then, category string will be the last pushed category string.

Definition at line 50 of file src/memory/heap_allocator.h.

Referenced by NLMISC::CHeapAllocator::allocate(), and NLMISC::CHeapAllocator::debugPushCategoryString().

#define NelRealloc heap,
size,
ptr,
category   )     (heap.reallocate (ptr, size, __FILE__, __LINE__, category))
 

Todo:
NelRealloc: category can be NULL. Then, category string will be the last pushed category string.

Definition at line 53 of file src/memory/heap_allocator.h.

#define NL_ALIGN_SIZE_FOR_SMALLBLOCK size   )     (((size) + SmallBlockGranularity-1) & ~(SmallBlockGranularity-1))
 

Definition at line 503 of file src/memory/heap_allocator.h.

Referenced by NLMISC::CHeapAllocator::allocate().

#define NL_HEAP_NODE_END_SIZE   sizeof(CNodeEnd)
 

Definition at line 324 of file src/memory/heap_allocator.h.

Referenced by NLMISC::CHeapAllocator::allocate(), NLMISC::CHeapAllocator::CHeapAllocator(), NLMISC::CHeapAllocator::debugStatisticsReport(), NLMEMORY::CHeapAllocator::evalMagicNumber(), NLMEMORY::CHeapAllocator::getBlockAllocationMode(), NLMEMORY::CHeapAllocator::getNodeSize(), NLMISC::CHeapAllocator::getSmallBlockMemory(), NLMISC::CHeapAllocator::initEmptyBlock(), NLMISC::CHeapAllocator::mergeNode(), and NLMISC::CHeapAllocator::splitNode().

#define NL_SIZE_TO_SMALLBLOCK_INDEX size   )     ((size-1)>>SmallBlockGranularityShift)
 

Definition at line 502 of file src/memory/heap_allocator.h.

Referenced by NLMISC::CHeapAllocator::allocate(), NLMISC::CHeapAllocator::debugStatisticsReport(), and NLMISC::CHeapAllocator::free().

#define NL_SMALLBLOCK_COUNT   (1+(LastSmallBlock - FirstSmallBlock)/SmallBlockGranularity)
 

Definition at line 501 of file src/memory/heap_allocator.h.

Referenced by NLMISC::CHeapAllocator::allocate(), NLMISC::CHeapAllocator::CHeapAllocator(), and NLMISC::CHeapAllocator::debugStatisticsReport().


Generated on Tue Mar 16 06:42:36 2004 for NeL by doxygen 1.3.6