Blender V4.3
blender::GuardedAlignedAllocator< Alignment > Class Template Reference

#include <BLI_allocator.hh>

Public Member Functions

void * allocate (size_t size, size_t alignment, const char *name)
 
void deallocate (void *ptr)
 

Static Public Attributes

static constexpr size_t min_alignment = Alignment
 

Detailed Description

template<size_t Alignment = 64ul>
class blender::GuardedAlignedAllocator< Alignment >

Like GuardedAllocator, but makes sure each allocation has a minimum alignment. One use case is reusing an allocation between multiple types that have different alignment requirements. The default alignment template parameter should be large enough for any type in practice.

Definition at line 60 of file BLI_allocator.hh.

Member Function Documentation

◆ allocate()

template<size_t Alignment = 64ul>
void * blender::GuardedAlignedAllocator< Alignment >::allocate ( size_t size,
size_t alignment,
const char * name )
inline

◆ deallocate()

template<size_t Alignment = 64ul>
void blender::GuardedAlignedAllocator< Alignment >::deallocate ( void * ptr)
inline

Definition at line 69 of file BLI_allocator.hh.

References MEM_freeN(), and ptr.

Member Data Documentation

◆ min_alignment

template<size_t Alignment = 64ul>
size_t blender::GuardedAlignedAllocator< Alignment >::min_alignment = Alignment
staticconstexpr

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