Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

SAPDBMem_RawAllocator::SAPDBMem_RawAllocator ( const SAPDB_UTF8 *  Identifier,
SAPDBMem_IBlockAllocator BlockAllocator,
SAPDB_ULong  FirstBlockSize,
SAPDB_ULong  SupplementBlockSize,
FreeRawExtendsEnum  FreeRawExtends,
SAPDB_ULong  MaxSize = SAPDBMEM_ALLOCATOR_UNLIMITED 
)

Constructs an allocator from the provided RawAllocator or BlockAllocator.

Parameters:
Identifier [in] the name of the allocator
BlockAllocator [in] The underlying block allocator
FirstBlockSize [in] The size of the memory block in bytes that the RawAllocator starts with.
SupplementBlockSize [in] The size of the memory blocks in bytes that are allocated, if the free memory is not sufficient to fulfill the next allocation.
FreeRawExtends [in] If FREE_RAW_EXTENDS, memory provided by RawAllocator is given back, whenever possible.
MaxSize [in] The maximal size of the total memory in bytes controlled by the RawAllocator.

Definition at line 1284 of file SAPDBMem_RawAllocator.cpp.

References CheckConstraints(), SAPDBMem_IAllocatorInfo::GetIdentifier(), RTEMem_AllocatorRegister::Instance(), m_AllocatorInfo, m_checkFlags, m_Name, m_usedChunks, RTE_ItemRegister< ItemType >::Register(), and SetIdentifier().

 : m_BlockAllocator(&BlockAllocator)
 , m_RawAllocator(NULL)
 , m_tracer(NULL)
 , m_firstSize(FirstBlockSize) 
 , m_supplement(SupplementBlockSize) 
 , m_maxHeap(MaxSize) 
 , m_freeLists() 
 , m_binBlocks(0)
 , m_checkFlags(GetCheckLevel())
 , m_heapInfo()
 , m_checkHeap(false)
 , m_freeRawExtends(FreeRawExtends)
 , m_opMessages(true)
 , m_writeProtected(false)
 , m_doUnregister(true)
 , m_monitorCallStackLevel(0)
 , m_errorCount(0)
 , m_badAllocFunc(SAPDBMem_RawAllocator::InitBadAllocHandler())
 , m_lock(0)
 , m_AllocatorInfo(Identifier)
 , m_usedChunks(NULL)
 , m_root(0)
 , m_next(REINTERPRET_CAST(CChunkPtr, &m_root))
 , m_prev(REINTERPRET_CAST(CChunkPtr, &m_root))
 , m_firstFreeNode(0)
 , m_freeNodeBuffer(0)
 , m_rawChunkTree(&m_rawChunkTreeComparator, &m_rawTreeAllocator)
{
  this->CheckConstraints();
#if defined(KERNEL)
  SetIdentifier(Identifier);
  m_AllocatorInfo = RTEMem_AllocatorInfo( &m_Name[0], this, BlockAllocator.GetIdentifier());

  RTEMem_AllocatorRegister::Instance().Register(m_AllocatorInfo);
#endif
  if (m_checkFlags & FL_DOUBLE_BOOKKEEPING)
  {
      m_usedChunks = new SAPDBMem_UsedChunkDirectory();
      if (!m_usedChunks)
      {
          m_checkFlags -= FL_DOUBLE_BOOKKEEPING;
      }
  }
}


Generated by  Doxygen 1.6.0   Back to index