BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma::LocalSequentialAllocator< t_SIZE > Class Template Reference

#include <bdlma_localsequentialallocator.h>

Inheritance diagram for bdlma::LocalSequentialAllocator< t_SIZE >:
bdlma::BufferedSequentialAllocator bdlma::ManagedAllocator bslma::Allocator bsl::memory_resource

Additional Inherited Members

- Public Types inherited from bslma::Allocator
typedef std::size_t size_type
 
- Public Member Functions inherited from bdlma::BufferedSequentialAllocator
 BufferedSequentialAllocator (char *buffer, bsls::Types::size_type size, bslma::Allocator *basicAllocator=0)
 
 BufferedSequentialAllocator (char *buffer, bsls::Types::size_type size, bsls::BlockGrowth::Strategy growthStrategy, bslma::Allocator *basicAllocator=0)
 
 BufferedSequentialAllocator (char *buffer, bsls::Types::size_type size, bsls::Alignment::Strategy alignmentStrategy, bslma::Allocator *basicAllocator=0)
 
 BufferedSequentialAllocator (char *buffer, bsls::Types::size_type size, bsls::BlockGrowth::Strategy growthStrategy, bsls::Alignment::Strategy alignmentStrategy, bslma::Allocator *basicAllocator=0)
 
 BufferedSequentialAllocator (char *buffer, bsls::Types::size_type size, bsls::Types::size_type maxBufferSize, bslma::Allocator *basicAllocator=0)
 
 BufferedSequentialAllocator (char *buffer, bsls::Types::size_type size, bsls::Types::size_type maxBufferSize, bsls::BlockGrowth::Strategy growthStrategy, bslma::Allocator *basicAllocator=0)
 
 BufferedSequentialAllocator (char *buffer, bsls::Types::size_type size, bsls::Types::size_type maxBufferSize, bsls::Alignment::Strategy alignmentStrategy, bslma::Allocator *basicAllocator=0)
 
 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)
 
 ~BufferedSequentialAllocator () BSLS_KEYWORD_OVERRIDE
 
void * allocate (size_type size) BSLS_KEYWORD_OVERRIDE
 
void deallocate (void *address) BSLS_KEYWORD_OVERRIDE
 
void release () BSLS_KEYWORD_OVERRIDE
 
virtual void rewind ()
 
bslma::Allocatorallocator () const
 Return the allocator passed at construction.
 
- Public Member Functions inherited from bslma::Allocator
 ~Allocator () BSLS_KEYWORD_OVERRIDE
 
template<class TYPE >
void deleteObject (const TYPE *object)
 
template<class TYPE >
void deleteObjectRaw (const TYPE *object)
 
void deleteObject (bsl::nullptr_t)
 
void deleteObjectRaw (bsl::nullptr_t)
 
- Public Member Functions inherited from bsl::memory_resource
 memory_resource () BSLS_KEYWORD_DEFAULT
 Create this object. Has no effect other than to begin its lifetime.
 
 memory_resource (const memory_resource &) BSLS_KEYWORD_DEFAULT
 
virtual ~memory_resource ()
 Destroy this object. Has no effect other than to end its lifetime.
 
memory_resourceoperator= (const memory_resource &) BSLS_KEYWORD_DEFAULT
 Return a modifiable reference to this object.
 
BSLS_ANNOTATION_NODISCARD void * allocate (size_t bytes, size_t alignment=k_MAX_ALIGN)
 
void deallocate (void *p, size_t bytes, size_t alignment=k_MAX_ALIGN)
 
bool is_equal (const memory_resource &other) const BSLS_KEYWORD_NOEXCEPT
 
- Static Public Member Functions inherited from bslma::Allocator
static void throwBadAlloc ()
 
- Protected Member Functions inherited from bslma::Allocator
void * do_allocate (std::size_t bytes, std::size_t alignment) BSLS_KEYWORD_OVERRIDE
 
void do_deallocate (void *p, std::size_t bytes, std::size_t alignment) BSLS_KEYWORD_OVERRIDE
 
bool do_is_equal (const memory_resource &other) const BSLS_KEYWORD_NOEXCEPT BSLS_KEYWORD_OVERRIDE
 

Detailed Description

template<int t_SIZE>
class bdlma::LocalSequentialAllocator< t_SIZE >

This class implements the ManagedAllocator protocol to provide a fast allocator that dispenses heterogeneous blocks of memory (of varying, user-specified sizes) from a local buffer whose capacity is the specified t_SIZE (in bytes). If an allocation request exceeds the remaining free memory space in the local buffer, memory will be supplied by an (optional) allocator supplied at construction; if no allocator is supplied, the currently installed default allocator is used. This class is exception neutral; if memory cannot be allocated, the behavior is defined by the (optional) allocator supplied at construction.

See bdlma_localsequentialallocator

Member Data Documentation

◆ d_align

template<int t_SIZE>
AlignmentType bdlma::LocalSequentialAllocator< t_SIZE >::d_align

◆ d_buffer

template<int t_SIZE>
char bdlma::LocalSequentialAllocator< t_SIZE >::d_buffer[t_SIZE]

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