Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Runtime::Internal::BlockAllocator Class Reference

Allocator class interface for managing large contiguous blocks of memory, which are then sub-allocated into smaller regions of memory. More...

#include <block_allocator.h>

Classes

struct  Config
 
struct  MemoryAllocators
 

Public Member Functions

 BlockAllocator (const BlockAllocator &)=delete
 
BlockAllocatoroperator= (const BlockAllocator &)=delete
 
 BlockAllocator ()=delete
 
 ~BlockAllocator ()=delete
 
MemoryRegionreserve (void *user_context, const MemoryRequest &request)
 
int conform (void *user_context, MemoryRequest *request) const
 
int release (void *user_context, MemoryRegion *region)
 
int reclaim (void *user_context, MemoryRegion *region)
 
int retain (void *user_context, MemoryRegion *region)
 
bool collect (void *user_context)
 
int release (void *user_context)
 
int destroy (void *user_context)
 
const MemoryAllocatorscurrent_allocators () const
 
const Configcurrent_config () const
 
const Configdefault_config () const
 
size_t block_count () const
 
size_t pool_size () const
 

Static Public Member Functions

static BlockAllocatorcreate (void *user_context, const Config &config, const MemoryAllocators &allocators)
 
static void destroy (void *user_context, BlockAllocator *block_allocator)
 

Detailed Description

Allocator class interface for managing large contiguous blocks of memory, which are then sub-allocated into smaller regions of memory.

This class only manages the address creation for the regions – allocation callback functions are used to request the memory from the necessary system or API calls. This class is intended to be used inside of a higher level memory management class that provides thread safety, policy management and API integration for a specific runtime API (eg Vulkan, OpenCL, etc)

Definition at line 25 of file block_allocator.h.

Constructor & Destructor Documentation

◆ BlockAllocator() [1/2]

Halide::Runtime::Internal::BlockAllocator::BlockAllocator ( const BlockAllocator & )
delete

◆ BlockAllocator() [2/2]

Halide::Runtime::Internal::BlockAllocator::BlockAllocator ( )
delete

◆ ~BlockAllocator()

Halide::Runtime::Internal::BlockAllocator::~BlockAllocator ( )
delete

Member Function Documentation

◆ operator=()

BlockAllocator & Halide::Runtime::Internal::BlockAllocator::operator= ( const BlockAllocator & )
delete

◆ create()

BlockAllocator * Halide::Runtime::Internal::BlockAllocator::create ( void * user_context,
const Config & config,
const MemoryAllocators & allocators )
static

◆ destroy() [1/2]

◆ reserve()

◆ conform()

◆ release() [1/2]

◆ reclaim()

◆ retain()

◆ collect()

◆ release() [2/2]

int Halide::Runtime::Internal::BlockAllocator::release ( void * user_context)

◆ destroy() [2/2]

int Halide::Runtime::Internal::BlockAllocator::destroy ( void * user_context)

◆ current_allocators()

◆ current_config()

const BlockAllocator::Config & Halide::Runtime::Internal::BlockAllocator::current_config ( ) const

Definition at line 624 of file block_allocator.h.

◆ default_config()

const BlockAllocator::Config & Halide::Runtime::Internal::BlockAllocator::default_config ( ) const

Definition at line 628 of file block_allocator.h.

◆ block_count()

size_t Halide::Runtime::Internal::BlockAllocator::block_count ( ) const

Definition at line 633 of file block_allocator.h.

References Halide::Runtime::Internal::LinkedList::size().

◆ pool_size()


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