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

void LVCMem_BlockAllocator::Deallocate ( void *  p,
SAPDB_ULong  BlockCount 
) [virtual]

Frees the memory.

None of the objects in the memory block will be deinitialised by this call. The size argument must match the value passed to 'allocate' to obtain this memory. The pointer argument must not be null. On failure, an exception is thrown.

p [ in ] the pointer returned by a previous allocate call.
BlockCount [ in ] Number of blocks (NOT bytes!) to deallocate.

Implements SAPDBMem_IBlockAllocator.

Definition at line 145 of file LVCMem_BlockAllocator.cpp.

References SAPDBMem_IBlockAllocator::Deallocate(), m_allocated, m_allocator, m_CountBaseDealloc, m_CountDealloc, m_defaultBlockCount, m_firstFree, m_limit, and m_spinlock.

  if (p) free(p);
  RTESync_LockedScope lockedScope(m_spinlock);
  if ((BlockCount == m_defaultBlockCount) && (m_allocated <= m_limit))
    NextPointer* pBlock = REINTERPRET_CAST(NextPointer*, p);
    pBlock->m_next = m_firstFree;
    m_firstFree = pBlock;
    m_allocator.Deallocate(p, BlockCount);
    m_allocated -= BlockCount;

Generated by  Doxygen 1.6.0   Back to index