Constructors
Synopses
Declared in <bdlma_bufferedsequentialallocator.h>
Create a buffered sequential allocator for allocating memory blocks from the specified external buffer having the specified size (in bytes). Optionally specify a growthStrategy used to control buffer growth. If a growthStrategy is not specified, geometric growth is used. Optionally specify an alignmentStrategy used to align allocated memory blocks. If an alignmentStrategy is not specified, natural alignment is used. Optionally specify a basicAllocator used to supply memory should the capacity of buffer be exhausted. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 < size, and buffer has at least size bytes. Note that, due to alignment effects, it is possible that not all size bytes of memory in buffer can be used for allocation. Also note that no limit is imposed on the size of the internal buffers when geometric growth is used. Also note that when constant growth is used, the size of the internal buffers will always be the same as size.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bslma::Allocator* basicAllocator = 0);
Create a buffered sequential allocator using the specified alignment strategy for allocations from buffer.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bsls::Alignment::Strategy alignmentStrategy,
bslma::Allocator* basicAllocator = 0);
Create a buffered sequential allocator using the specified growth strategy for allocations from buffer.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bsls::BlockGrowth::Strategy growthStrategy,
bslma::Allocator* basicAllocator = 0);
Create a buffered sequential allocator for allocating memory blocks from the specified external buffer having the specified size (in bytes), or from an internal buffer (after the external buffer is exhausted) where the buffer growth is limited to the specified maxBufferSize (in bytes). Optionally specify a growthStrategy used to control buffer growth. If a growthStrategy is not specified, geometric growth is used. Optionally specify an alignmentStrategy used to align allocated memory blocks. If an alignmentStrategy is not specified, natural alignment is used. Optionally specify a basicAllocator used to supply memory should the capacity of buffer be exhausted. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 < size, size <= maxBufferSize, and buffer has at least size bytes. Note that, due to alignment effects, it is possible that not all size bytes of memory in buffer can be used for allocation. Also note that when constant growth is used, the size of the internal buffers will always be the same as size. Create a buffered sequential allocator with growth limited to maxBufferSize.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bsls::Types::size_type maxBufferSize,
bslma::Allocator* basicAllocator = 0);
Create a buffered sequential allocator using the specified growth and alignment strategies for allocations from buffer.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bsls::BlockGrowth::Strategy growthStrategy,
bsls::Alignment::Strategy alignmentStrategy,
bslma::Allocator* basicAllocator = 0);
Create a buffered sequential allocator with the specified alignment strategy.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bsls::Types::size_type maxBufferSize,
bsls::Alignment::Strategy alignmentStrategy,
bslma::Allocator* basicAllocator = 0);
Create a buffered sequential allocator with growth limited to maxBufferSize and the specified growth strategy.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bsls::Types::size_type maxBufferSize,
bsls::BlockGrowth::Strategy growthStrategy,
bslma::Allocator* basicAllocator = 0);
Create a buffered sequential allocator with the specified growth and alignment strategies.
BufferedSequentialAllocator(
char* buffer,
bsls::Types::size_type size,
bsls::Types::size_type maxBufferSize,
bsls::BlockGrowth::Strategy growthStrategy,
bsls::Alignment::Strategy alignmentStrategy,
bslma::Allocator* basicAllocator = 0);
Created with MrDocs