Halide 19.0.0
Halide compiler and libraries
|
#include <memory_arena.h>
Classes | |
struct | Config |
Public Member Functions | |
MemoryArena (const MemoryArena &)=delete | |
MemoryArena & | operator= (const MemoryArena &)=delete |
MemoryArena (void *user_context, const Config &config=default_config(), const SystemMemoryAllocatorFns &allocator=default_allocator()) | |
~MemoryArena () | |
void | initialize (void *user_context, const Config &config, const SystemMemoryAllocatorFns &allocator=default_allocator()) |
void * | reserve (void *user_context, bool initialize=false) |
void | reclaim (void *user_context, void *ptr) |
bool | collect (void *user_context) |
void | destroy (void *user_context) |
const Config & | current_config () const |
const SystemMemoryAllocatorFns & | current_allocator () const |
Static Public Member Functions | |
static MemoryArena * | create (void *user_context, const Config &config, const SystemMemoryAllocatorFns &allocator=default_allocator()) |
static void | destroy (void *user_context, MemoryArena *arena) |
static const Config & | default_config () |
static const SystemMemoryAllocatorFns & | default_allocator () |
Static Public Attributes | |
static constexpr uint32_t | default_capacity = uint32_t(32) |
Definition at line 17 of file memory_arena.h.
|
delete |
|
explicit |
Definition at line 89 of file memory_arena.h.
Halide::Runtime::Internal::MemoryArena::~MemoryArena | ( | ) |
Definition at line 97 of file memory_arena.h.
References destroy().
|
delete |
|
static |
Definition at line 101 of file memory_arena.h.
References Halide::Runtime::Internal::SystemMemoryAllocatorFns::allocate, halide_debug_assert, halide_error(), and initialize().
Referenced by Halide::Runtime::Internal::LinkedList::initialize(), and Halide::Runtime::Internal::LinkedList::LinkedList().
|
static |
Definition at line 115 of file memory_arena.h.
References Halide::Runtime::Internal::BlockStorage::current_allocator(), Halide::Runtime::Internal::SystemMemoryAllocatorFns::deallocate, destroy(), and halide_debug_assert.
Referenced by Halide::Runtime::Internal::LinkedList::destroy(), destroy(), Halide::Runtime::Internal::RegionAllocator::destroy(), and ~MemoryArena().
void Halide::Runtime::Internal::MemoryArena::initialize | ( | void * | user_context, |
const Config & | config, | ||
const SystemMemoryAllocatorFns & | allocator = default_allocator() ) |
Definition at line 123 of file memory_arena.h.
References halide_debug_assert, Halide::Runtime::Internal::BlockStorage::initialize(), and Halide::Runtime::Internal::MemoryArena::Config::minimum_block_capacity.
void * Halide::Runtime::Internal::MemoryArena::reserve | ( | void * | user_context, |
bool | initialize = false ) |
Definition at line 155 of file memory_arena.h.
References Halide::Runtime::Internal::MemoryArena::Config::entry_size, halide_debug_assert, halide_error(), initialize(), Halide::Runtime::Internal::MemoryArena::Config::maximum_block_count, memset(), and Halide::Runtime::Internal::BlockStorage::size().
void Halide::Runtime::Internal::MemoryArena::reclaim | ( | void * | user_context, |
void * | ptr ) |
Definition at line 182 of file memory_arena.h.
References Halide::Runtime::Internal::MemoryArena::Config::entry_size, halide_debug_assert, halide_error(), Halide::Runtime::Internal::offset_address(), and Halide::Runtime::Internal::BlockStorage::size().
bool Halide::Runtime::Internal::MemoryArena::collect | ( | void * | user_context | ) |
Definition at line 142 of file memory_arena.h.
References halide_debug_assert, Halide::Runtime::Internal::BlockStorage::remove(), and Halide::Runtime::Internal::BlockStorage::size().
void Halide::Runtime::Internal::MemoryArena::destroy | ( | void * | user_context | ) |
Definition at line 131 of file memory_arena.h.
References Halide::Runtime::Internal::BlockStorage::destroy(), Halide::Runtime::Internal::BlockStorage::empty(), halide_debug_assert, and Halide::Runtime::Internal::BlockStorage::size().
const MemoryArena::Config & Halide::Runtime::Internal::MemoryArena::current_config | ( | ) | const |
Definition at line 287 of file memory_arena.h.
Referenced by Halide::Runtime::Internal::LinkedList::append(), Halide::Runtime::Internal::LinkedList::insert_after(), Halide::Runtime::Internal::LinkedList::insert_before(), and Halide::Runtime::Internal::LinkedList::prepend().
|
static |
Definition at line 292 of file memory_arena.h.
const SystemMemoryAllocatorFns & Halide::Runtime::Internal::MemoryArena::current_allocator | ( | ) | const |
Definition at line 298 of file memory_arena.h.
References Halide::Runtime::Internal::BlockStorage::current_allocator().
Referenced by Halide::Runtime::Internal::LinkedList::current_allocator().
|
static |
Definition at line 303 of file memory_arena.h.
References Halide::Runtime::Internal::BlockStorage::default_allocator().
Referenced by Halide::Runtime::Internal::LinkedList::default_allocator().
Definition at line 24 of file memory_arena.h.
Referenced by Halide::Runtime::Internal::LinkedList::initialize(), and Halide::Runtime::Internal::LinkedList::LinkedList().