PCL
|
A block allocator class for aligned memory allocation/deallocation. More...
#include <AlignedAllocator.h>
Public Member Functions | |
AlignedAllocator (bool fastGrowth=true, bool canShrink=true) | |
AlignedAllocator (const AlignedAllocator &)=default | |
void * | AllocateBlock (size_type size) |
void | DeallocateBlock (void *p) |
Public Member Functions inherited from pcl::StandardAllocator | |
StandardAllocator (bool fastGrowth=true, bool canShrink=true) | |
StandardAllocator (const StandardAllocator &)=default | |
void * | AllocateBlock (size_type size) |
size_type | BlockSize (size_type n) const |
void | DeallocateBlock (void *p) |
void | DisableFastGrowth (bool disable=true) |
void | DisableShrinking (bool disable=true) |
void | EnableFastGrowth (bool enable=true) |
void | EnableShrinking (bool enable=true) |
bool | IsFastGrowthEnabled () const |
bool | IsShrinkingEnabled () const |
size_type | MaxSize () const |
size_type | ReallocatedBlockSize (size_type currentSize, size_type newSize) const |
AlignedAllocator is a block allocator class. It can be used for all PCL container classes instead of the default StandardAllocator class, from which it derives publicly, providing exactly the same memory allocation policies.
AlignedAllocator guarantees that all allocated memory blocks are aligned for optimal performance of SIMD processor instructions on all supported platforms. Currently all blocks are allocated with 32 byte alignment, which is optimal for both SSE and AVX2 load/store instructions.
For a complete description of block allocators and their fundamental role in PCL, read the documentation for the Allocator class.
Definition at line 86 of file AlignedAllocator.h.
|
inline |
Constructs an AlignedAllocator object.
fastGrowth | Whether to enable the fast block size growing policy for this allocator. |
canShrink | Whether to enable the block shrinking policy for this allocator. |
See the IsFastGrowthEnabled() and IsShrinkingEnabled() member functions for more information on block allocation policies.
Definition at line 102 of file AlignedAllocator.h.
|
default |
Copy constructor.
|
inline |
Custom allocation routine. Allocates a contiguous memory block of the specified size in bytes with 32-byte alignment, and returns the address of the first byte in the newly allocated block.
Definition at line 122 of file AlignedAllocator.h.
|
inline |
Custom deallocation routine. Deallocates a previously allocated contiguous memory block that begins at the specified location p.
Definition at line 140 of file AlignedAllocator.h.