AlignedSysAllocator

Synopsis

Declared in <folly/memory/Allocator.h>

template<
    typename T,
    typename Align = DefaultAlign>
class AlignedSysAllocator;

Description

Resembles std::allocator, the default Allocator, but wraps aligned_malloc and aligned_free.

Accepts a policy parameter for providing the alignment, which must: * be invocable as std::size_t(std::size_t) noexcept * taking the type alignment and returning the allocation alignment * be noexcept‐copy‐constructible * have noexcept operator== * have noexcept operator!= * not be final

DefaultAlign and FixedAlign<std::size_t>, provided above, are valid policies.

Type Aliases

Name

Description

propagate_on_container_copy_assignment

Propagates the allocator on container copy assignment.

propagate_on_container_move_assignment

Propagates the allocator on container move assignment.

propagate_on_container_swap

Propagates the allocator on container swap.

value_type

The type of object allocated by this allocator.

Member Functions

Name

Description

AlignedSysAllocator [constructor]

Constructors

allocate

Allocates aligned storage for count objects of type T.

deallocate

Deallocates storage previously obtained from allocate.

Using Declarations

Friends

Name

Description

folly::operator!=

Compares two allocators for inequality.

folly::operator==

Compares two allocators for equality.

folly::AlignedSysAllocator

AlignedSysAllocator

Created with MrDocs