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

#include <bmesh_polygon.hh>

Public Member Functions

void * allocate (size_t size, size_t alignment, const char *name)
void * allocate_zero (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::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 71 of file bmesh_polygon.hh.

Member Function Documentation

◆ allocate()

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

Definition at line 75 of file bmesh_polygon.hh.

References blender::ATTR_NONNULL().

◆ allocate_zero()

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

◆ deallocate()

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

Definition at line 90 of file bmesh_polygon.hh.

Member Data Documentation

◆ min_alignment

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

Definition at line 73 of file bmesh_polygon.hh.


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