Thrill  0.1
FixedAllocator< Type, manager_ > Class Template Reference

Detailed Description

template<typename Type, Manager & manager_>
class thrill::mem::FixedAllocator< Type, manager_ >

Definition at line 37 of file allocator_base.hpp.

+ Inheritance diagram for FixedAllocator< Type, manager_ >:
+ Collaboration diagram for FixedAllocator< Type, manager_ >:

#include <allocator_base.hpp>

Classes

struct  rebind
 Return allocator for different type. More...
 

Public Types

using const_pointer = const Type *
 
using const_reference = const Type &
 
using difference_type = std::ptrdiff_t
 
using is_always_equal = std::true_type
 C++11 type flag. More...
 
using pointer = Type *
 
using reference = Type &
 
using size_type = std::size_t
 
using value_type = Type
 
- Public Types inherited from AllocatorBase< Type >
using const_pointer = const Type *
 
using const_reference = const Type &
 
using difference_type = std::ptrdiff_t
 
using is_always_equal = std::true_type
 C++11 type flag. More...
 
using pointer = Type *
 
using propagate_on_container_move_assignment = std::true_type
 C++11 type flag. More...
 
using reference = Type &
 
using size_type = std::size_t
 
using value_type = Type
 

Public Member Functions

 FixedAllocator () noexcept=default
 default constructor More...
 
 FixedAllocator (const FixedAllocator &) noexcept=default
 copy-constructor More...
 
template<typename OtherType >
 FixedAllocator (const FixedAllocator< OtherType, manager_ > &) noexcept
 copy-constructor from a rebound allocator More...
 
pointer allocate (size_type n, const void *=nullptr)
 
void deallocate (pointer p, size_type n) const noexcept
 
template<typename Other >
bool operator!= (const FixedAllocator< Other, manager_ > &) const noexcept
 Compare to another allocator of same type. More...
 
FixedAllocatoroperator= (FixedAllocator &) noexcept=default
 copy-assignment operator: default More...
 
FixedAllocatoroperator= (FixedAllocator &&) noexcept=default
 move-assignment operator: default More...
 
template<typename Other >
bool operator== (const FixedAllocator< Other, manager_ > &) const noexcept
 Compare to another allocator of same type. More...
 
- Public Member Functions inherited from AllocatorBase< Type >
pointer address (reference x) const noexcept
 Returns the address of x. More...
 
const_pointer address (const_reference x) const noexcept
 Returns the address of x. More...
 
void construct (pointer p, const_reference value)
 Constructs an element object on the location pointed by p. More...
 
template<typename SubType , typename... Args>
void construct (SubType *p, Args &&... args)
 Constructs an element object on the location pointed by p. More...
 
void destroy (pointer p) const noexcept
 Destroys in-place the object pointed by p. More...
 
template<typename SubType >
void destroy (SubType *p) const noexcept
 Destroys in-place the object pointed by p. More...
 
size_type max_size () const noexcept
 Maximum size possible to allocate. More...
 

Static Private Attributes

static constexpr bool debug = false
 

Member Typedef Documentation

◆ const_pointer

using const_pointer = const Type *

Definition at line 44 of file allocator_base.hpp.

◆ const_reference

using const_reference = const Type&

Definition at line 46 of file allocator_base.hpp.

◆ difference_type

using difference_type = std::ptrdiff_t

Definition at line 48 of file allocator_base.hpp.

◆ is_always_equal

using is_always_equal = std::true_type

C++11 type flag.

Definition at line 51 of file allocator_base.hpp.

◆ pointer

using pointer = Type *

Definition at line 43 of file allocator_base.hpp.

◆ reference

using reference = Type&

Definition at line 45 of file allocator_base.hpp.

◆ size_type

using size_type = std::size_t

Definition at line 47 of file allocator_base.hpp.

◆ value_type

using value_type = Type

Definition at line 42 of file allocator_base.hpp.

Constructor & Destructor Documentation

◆ FixedAllocator() [1/3]

FixedAllocator ( )
defaultnoexcept

default constructor

◆ FixedAllocator() [2/3]

FixedAllocator ( const FixedAllocator< Type, manager_ > &  )
defaultnoexcept

copy-constructor

◆ FixedAllocator() [3/3]

FixedAllocator ( const FixedAllocator< OtherType, manager_ > &  )
inlinenoexcept

copy-constructor from a rebound allocator

Definition at line 65 of file allocator_base.hpp.

References FixedAllocator< Type, manager_ >::operator=().

Member Function Documentation

◆ allocate()

pointer allocate ( size_type  n,
const void *  = nullptr 
)
inline

Attempts to allocate a block of storage with a size large enough to contain n elements of member type value_type, and returns a pointer to the first element.

Definition at line 79 of file allocator_base.hpp.

References thrill::mem::bypass_malloc(), and AllocatorBase< Type >::max_size().

Referenced by thrill::mem::by_new().

◆ deallocate()

void deallocate ( pointer  p,
size_type  n 
) const
inlinenoexcept

Releases a block of storage previously allocated with member allocate and not yet released.

Definition at line 107 of file allocator_base.hpp.

References thrill::mem::bypass_free().

Referenced by thrill::mem::by_delete().

◆ operator!=()

bool operator!= ( const FixedAllocator< Other, manager_ > &  ) const
inlinenoexcept

Compare to another allocator of same type.

Definition at line 127 of file allocator_base.hpp.

◆ operator=() [1/2]

FixedAllocator& operator= ( FixedAllocator< Type, manager_ > &  )
defaultnoexcept

copy-assignment operator: default

Referenced by FixedAllocator< Type, manager_ >::FixedAllocator().

◆ operator=() [2/2]

FixedAllocator& operator= ( FixedAllocator< Type, manager_ > &&  )
defaultnoexcept

move-assignment operator: default

◆ operator==()

bool operator== ( const FixedAllocator< Other, manager_ > &  ) const
inlinenoexcept

Compare to another allocator of same type.

Definition at line 121 of file allocator_base.hpp.

Member Data Documentation

◆ debug

constexpr bool debug = false
staticprivate

Definition at line 39 of file allocator_base.hpp.


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