BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma::InfrequentDeleteBlockList Class Reference

#include <bdlma_infrequentdeleteblocklist.h>

Public Member Functions

 InfrequentDeleteBlockList (bslma::Allocator *basicAllocator=0)
 
 ~InfrequentDeleteBlockList ()
 
void * allocate (bsls::Types::size_type size)
 
void deallocate (void *address)
 
void release ()
 
void releaseAllButLastBlock ()
 
bslma::Allocatorallocator () const
 Return the allocator used by this object to supply memory.
 

Detailed Description

This class implements a low-level memory manager that allocates and manages a sequence of memory blocks – each potentially of a different size as specified during the invocation of the allocate method. The release method deallocates the entire sequence of memory blocks, as does the destructor. Note that memory blocks cannot be deallocated individually.

See bdlma_infrequentdeleteblocklist

Constructor & Destructor Documentation

◆ InfrequentDeleteBlockList()

bdlma::InfrequentDeleteBlockList::InfrequentDeleteBlockList ( bslma::Allocator basicAllocator = 0)
inlineexplicit

Create an empty block list suitable for managing memory blocks of varying sizes. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~InfrequentDeleteBlockList()

bdlma::InfrequentDeleteBlockList::~InfrequentDeleteBlockList ( )

Destroy this object and deallocate all outstanding memory blocks managed by this object.

Member Function Documentation

◆ allocate()

void * bdlma::InfrequentDeleteBlockList::allocate ( bsls::Types::size_type  size)

Return the address of a contiguous block of memory of the specified size (in bytes). If size is 0, no memory is allocated and 0 is returned. The returned memory is guaranteed to be maximally aligned.

◆ allocator()

bslma::Allocator * bdlma::InfrequentDeleteBlockList::allocator ( ) const
inline

◆ deallocate()

void bdlma::InfrequentDeleteBlockList::deallocate ( void *  address)
inline

This method has no effect on the memory block at the specified address as all memory allocated by this object is managed. The behavior is undefined unless address was allocated by this object, and has not already been released.

◆ release()

void bdlma::InfrequentDeleteBlockList::release ( )

Deallocate all memory blocks managed by this object, returning this object to its default-constructed state.

◆ releaseAllButLastBlock()

void bdlma::InfrequentDeleteBlockList::releaseAllButLastBlock ( )

Deallocate all except the most-recently obtained block of the memory blocks managed by this object. If no blocks are managed, this method has no effect.


The documentation for this class was generated from the following file: