If Version is 1, the allocator is a STL conforming allocator. More...
#include <container_fwd.hpp>
Classes | |
struct | rebind |
Obtains an allocator that allocates objects of type T2. More... | |
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
typedef std::size_t | size_type |
typedef std::ptrdiff_t | difference_type |
typedef boost::container::container_detail::version_type < self_t, Version > | version |
typedef boost::container::container_detail::basic_multiallocation_chain < void * > | void_multiallocation_chain |
typedef boost::container::container_detail::transform_multiallocation_chain < void_multiallocation_chain, T > | multiallocation_chain |
Public Member Functions | |
allocator () BOOST_CONTAINER_NOEXCEPT | |
Default constructor Never throws. More... | |
allocator (const allocator &) BOOST_CONTAINER_NOEXCEPT | |
Constructor from other allocator. More... | |
template<class T2 > | |
allocator (const allocator< T2, Version, AllocationDisableMask > &) BOOST_CONTAINER_NOEXCEPT | |
Constructor from related allocator. More... | |
pointer | allocate (size_type count, const void *hint=0) |
Allocates memory for an array of count elements. More... | |
void | deallocate (pointer ptr, size_type) BOOST_CONTAINER_NOEXCEPT |
Deallocates previously allocated memory. More... | |
size_type | max_size () const BOOST_CONTAINER_NOEXCEPT |
Returns the maximum number of elements that could be allocated. More... | |
std::pair< pointer, bool > | allocation_command (allocation_type command, size_type limit_size, size_type preferred_size, size_type &received_size, pointer reuse=pointer()) |
An advanced function that offers in-place expansion shrink to fit and new allocation capabilities. More... | |
size_type | size (pointer p) const BOOST_CONTAINER_NOEXCEPT |
Returns maximum the number of objects the previously allocated memory pointed by p can hold. More... | |
pointer | allocate_one () |
Allocates just one object. More... | |
void | allocate_individual (std::size_t num_elements, multiallocation_chain &chain) |
Allocates many elements of size == 1. More... | |
void | deallocate_one (pointer p) BOOST_CONTAINER_NOEXCEPT |
Deallocates memory previously allocated with allocate_one(). More... | |
void | deallocate_individual (multiallocation_chain &chain) BOOST_CONTAINER_NOEXCEPT |
Deallocates memory allocated with allocate_one() or allocate_individual(). More... | |
void | allocate_many (size_type elem_size, std::size_t n_elements, multiallocation_chain &chain) |
Allocates many elements of size elem_size. More... | |
void | allocate_many (const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain) |
Allocates n_elements elements, each one of size elem_sizes[i] Elements must be individually deallocated with deallocate() This function is available only with Version == 2. More... | |
void | deallocate_many (multiallocation_chain &chain) BOOST_CONTAINER_NOEXCEPT |
Deallocates several elements allocated by allocate_many(), allocate(), or allocation_command(). More... | |
Friends | |
void | swap (self_t &, self_t &) BOOST_CONTAINER_NOEXCEPT |
Swaps two allocators, does nothing because this allocator is stateless. More... | |
bool | operator== (const allocator &, const allocator &) BOOST_CONTAINER_NOEXCEPT |
An allocator always compares to true, as memory allocated with one instance can be deallocated by another instance. More... | |
bool | operator!= (const allocator &, const allocator &) BOOST_CONTAINER_NOEXCEPT |
An allocator always compares to false, as memory allocated with one instance can be deallocated by another instance. More... | |
If Version is 1, the allocator is a STL conforming allocator.
If Version is 2, the allocator offers advanced expand in place and burst allocation capabilities. AllocationDisableMask works only if Version is 2 and it can be an inclusive OR of allocation types the user wants to disable.
typedef const T* boost::container::allocator< T, Version, AllocationDisableMask >::const_pointer |
typedef const T& boost::container::allocator< T, Version, AllocationDisableMask >::const_reference |
typedef std::ptrdiff_t boost::container::allocator< T, Version, AllocationDisableMask >::difference_type |
typedef boost::container::container_detail:: transform_multiallocation_chain<void_multiallocation_chain, T> boost::container::allocator< T, Version, AllocationDisableMask >::multiallocation_chain |
typedef T* boost::container::allocator< T, Version, AllocationDisableMask >::pointer |
typedef T& boost::container::allocator< T, Version, AllocationDisableMask >::reference |
typedef std::size_t boost::container::allocator< T, Version, AllocationDisableMask >::size_type |
typedef T boost::container::allocator< T, Version, AllocationDisableMask >::value_type |
typedef boost::container::container_detail:: version_type<self_t, Version> boost::container::allocator< T, Version, AllocationDisableMask >::version |
typedef boost::container::container_detail:: basic_multiallocation_chain<void*> boost::container::allocator< T, Version, AllocationDisableMask >::void_multiallocation_chain |
|
inline |
Default constructor Never throws.
|
inline |
Constructor from other allocator.
Never throws
|
inline |
Constructor from related allocator.
Never throws
|
inline |
Allocates memory for an array of count elements.
Throws std::bad_alloc if there is no enough memory If Version is 2, this allocated memory can only be deallocated with deallocate() or (for Version == 2) deallocate_many()
References boost::container::allocator< T, Version, AllocationDisableMask >::max_size(), T, boost::container::throw_bad_alloc(), and boost::detail::void.
Referenced by boost::container::allocator< T, Version, AllocationDisableMask >::allocate_one().
|
inline |
Allocates many elements of size == 1.
Elements must be individually deallocated with deallocate_one() This function is available only with Version == 2
References boost::container::allocator< T, Version, AllocationDisableMask >::allocate_many().
|
inline |
Allocates many elements of size elem_size.
Elements must be individually deallocated with deallocate() This function is available only with Version == 2
References T, and boost::container::throw_bad_alloc().
Referenced by boost::container::allocator< T, Version, AllocationDisableMask >::allocate_individual().
|
inline |
Allocates n_elements elements, each one of size elem_sizes[i] Elements must be individually deallocated with deallocate() This function is available only with Version == 2.
References T, and boost::container::throw_bad_alloc().
|
inline |
Allocates just one object.
Memory allocated with this function must be deallocated only with deallocate_one(). Throws bad_alloc if there is no enough memory This function is available only with Version == 2
References boost::container::allocator< T, Version, AllocationDisableMask >::allocate().
|
inline |
An advanced function that offers in-place expansion shrink to fit and new allocation capabilities.
Memory allocated with this function can only be deallocated with deallocate() or deallocate_many(). This function is available only with Version == 2
References boost::container::throw_bad_alloc().
|
inline |
Deallocates previously allocated memory.
Never throws
Referenced by boost::container::allocator< T, Version, AllocationDisableMask >::deallocate_one().
|
inline |
Deallocates memory allocated with allocate_one() or allocate_individual().
This function is available only with Version == 2
References boost::container::allocator< T, Version, AllocationDisableMask >::deallocate_many().
|
inline |
Deallocates several elements allocated by allocate_many(), allocate(), or allocation_command().
This function is available only with Version == 2
References boost::last, and boost::container::allocator< T, Version, AllocationDisableMask >::size().
Referenced by boost::container::allocator< T, Version, AllocationDisableMask >::deallocate_individual().
|
inline |
Deallocates memory previously allocated with allocate_one().
You should never use deallocate_one to deallocate memory allocated with other functions different from allocate_one() or allocate_individual.
References boost::container::allocator< T, Version, AllocationDisableMask >::deallocate(), and boost::multiprecision::backends::p.
|
inline |
Returns the maximum number of elements that could be allocated.
Never throws
References T.
Referenced by boost::container::allocator< T, Version, AllocationDisableMask >::allocate().
|
inline |
Returns maximum the number of objects the previously allocated memory pointed by p can hold.
Memory must not have been allocated with allocate_one or allocate_individual. This function is available only with Version == 2
References boost::multiprecision::backends::p.
Referenced by boost::container::allocator< T, Version, AllocationDisableMask >::deallocate_many().
|
friend |
An allocator always compares to false, as memory allocated with one instance can be deallocated by another instance.
|
friend |
An allocator always compares to true, as memory allocated with one instance can be deallocated by another instance.
|
friend |
Swaps two allocators, does nothing because this allocator is stateless.