PCL
pcl::AlignedAllocator Class Reference

A block allocator class for aligned memory allocation/deallocation. More...

#include <AlignedAllocator.h>

+ Inheritance diagram for pcl::AlignedAllocator:

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
 

Detailed Description

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.

See also
Allocator, StandardAllocator

Definition at line 86 of file AlignedAllocator.h.

Constructor & Destructor Documentation

◆ AlignedAllocator() [1/2]

pcl::AlignedAllocator::AlignedAllocator ( bool  fastGrowth = true,
bool  canShrink = true 
)
inline

Constructs an AlignedAllocator object.

Parameters
fastGrowthWhether to enable the fast block size growing policy for this allocator.
canShrinkWhether 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.

◆ AlignedAllocator() [2/2]

pcl::AlignedAllocator::AlignedAllocator ( const AlignedAllocator )
default

Copy constructor.

Member Function Documentation

◆ AllocateBlock()

void* pcl::AlignedAllocator::AllocateBlock ( size_type  size)
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.

Note
This member function is mandatory for a block allocator to be usable by the Allocator class.
See also
DeallocateBlock()

Definition at line 122 of file AlignedAllocator.h.

◆ DeallocateBlock()

void pcl::AlignedAllocator::DeallocateBlock ( void *  p)
inline

Custom deallocation routine. Deallocates a previously allocated contiguous memory block that begins at the specified location p.

Note
This member function is mandatory for a block allocator to be usable by the Allocator class.
See also
AllocateBlock()

Definition at line 140 of file AlignedAllocator.h.


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