Blender V5.3
blender::RawAllocator Class Reference

#include <BLI_allocator.hh>

Public Member Functions

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

Detailed Description

This is a wrapper around malloc/free. Only use this when the GuardedAllocator cannot be used. This can be the case when the allocated memory might live longer than Blender's allocator. For example, when the memory is owned by a static variable.

Definition at line 101 of file BLI_allocator.hh.

Member Function Documentation

◆ allocate()

void * blender::RawAllocator::allocate ( size_t size,
size_t alignment,
const char *  )
inline

Definition at line 108 of file BLI_allocator.hh.

References blender::BLI_assert(), blender::is_power_of_2(), and POINTER_OFFSET.

Referenced by allocate_zero().

◆ allocate_zero()

void * blender::RawAllocator::allocate_zero ( size_t size,
size_t alignment,
const char * name )
inline

Definition at line 119 of file BLI_allocator.hh.

References allocate().

◆ deallocate()

void blender::RawAllocator::deallocate ( void * ptr)
inline

Definition at line 126 of file BLI_allocator.hh.

References blender::bke::subdiv::free(), and POINTER_OFFSET.


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