Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions src/runtime/internal/block_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class BlockAllocator {
int reclaim(void *user_context, MemoryRegion *region); //< free the region and consolidate
int retain(void *user_context, MemoryRegion *region); //< retain the region and increase the usage count
bool collect(void *user_context); //< returns true if any blocks were removed
int release(void *user_context);
int destroy(void *user_context);

// Access methods
Expand Down Expand Up @@ -95,9 +94,6 @@ class BlockAllocator {
// Creates a new block entry and adds it tos the list
BlockEntry *create_block_entry(void *user_context, const MemoryRequest &request);

// Releases the block entry from being used, and makes it available for further allocations
int release_block_entry(void *user_context, BlockEntry *block_entry);

// Destroys the block entry and removes it from the list
int destroy_block_entry(void *user_context, BlockEntry *block_entry);

Expand Down Expand Up @@ -265,16 +261,6 @@ bool BlockAllocator::collect(void *user_context) {
return result;
}

int BlockAllocator::release(void *user_context) {
BlockEntry *block_entry = block_list.back();
while (block_entry != nullptr) {
BlockEntry *prev_entry = block_entry->prev_ptr;
release_block_entry(user_context, block_entry);
block_entry = prev_entry;
}
return 0;
}

int BlockAllocator::destroy(void *user_context) {
BlockEntry *block_entry = block_list.back();
while (block_entry != nullptr) {
Expand Down Expand Up @@ -504,19 +490,6 @@ BlockAllocator::create_block_entry(void *user_context, const MemoryRequest &requ
return block_entry;
}

int BlockAllocator::release_block_entry(void *user_context, BlockAllocator::BlockEntry *block_entry) {
#ifdef DEBUG_RUNTIME_INTERNAL
debug(user_context) << "BlockAllocator: Releasing block entry ("
<< "block_entry=" << (void *)(block_entry) << " "
<< "block=" << (void *)(block_entry->value) << ")...";
#endif
BlockResource *block = static_cast<BlockResource *>(block_entry->value);
if (block->allocator) {
return block->allocator->release(user_context);
}
return 0;
}

int BlockAllocator::destroy_block_entry(void *user_context, BlockAllocator::BlockEntry *block_entry) {
#ifdef DEBUG_RUNTIME_INTERNAL
debug(user_context) << "BlockAllocator: Destroying block entry ("
Expand Down
18 changes: 0 additions & 18 deletions src/runtime/internal/region_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class RegionAllocator {
int reclaim(void *user_context, MemoryRegion *memory_region); //< free the region and consolidate
int retain(void *user_context, MemoryRegion *memory_region); //< retain the region and increase usage count
bool collect(void *user_context); //< returns true if any blocks were removed
int release(void *user_context);
int destroy(void *user_context);

// Returns the currently managed block resource
Expand Down Expand Up @@ -672,23 +671,6 @@ int RegionAllocator::free_block_region(void *user_context, BlockRegion *block_re
return error_code;
}

int RegionAllocator::release(void *user_context) {
#ifdef DEBUG_RUNTIME_INTERNAL
debug(user_context) << "RegionAllocator: Releasing all regions ("
<< "user_context=" << (void *)(user_context) << ") ...";
#endif

BlockRegion *block_region = block->regions;
while (block_region != nullptr) {
release_block_region(user_context, block_region);
if (is_last_block_region(user_context, block_region)) {
break;
}
block_region = block_region->next_ptr;
}
return 0;
}

bool RegionAllocator::collect(void *user_context) {
#ifdef DEBUG_RUNTIME_INTERNAL
debug(user_context) << "RegionAllocator: Collecting free block regions ("
Expand Down
18 changes: 0 additions & 18 deletions src/runtime/vulkan_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class VulkanMemoryAllocator {
int reclaim(void *user_context, MemoryRegion *region); //< free the region and consolidate
int retain(void *user_context, MemoryRegion *region); //< retain the region and increase its use count
bool collect(void *user_context); //< returns true if any blocks were removed
int release(void *user_context);
int destroy(void *user_context);

void *map(void *user_context, MemoryRegion *region);
Expand Down Expand Up @@ -504,23 +503,6 @@ bool VulkanMemoryAllocator::collect(void *user_context) {
return block_allocator->collect(this);
}

int VulkanMemoryAllocator::release(void *user_context) {
#if defined(HL_VK_DEBUG_MEM)
debug(nullptr) << "VulkanMemoryAllocator: Releasing block allocator ("
<< "user_context=" << user_context << ") ... \n";
#endif
if ((device == nullptr) || (physical_device == nullptr)) {
error(user_context) << "VulkanMemoryAllocator: Unable to release allocator! Invalid device handle!\n";
return halide_error_code_generic_error;
}
if (block_allocator == nullptr) {
error(user_context) << "VulkanMemoryAllocator: Unable to release allocator! Invalid block allocator!\n";
return halide_error_code_generic_error;
}

return block_allocator->release(this);
}

int VulkanMemoryAllocator::destroy(void *user_context) {
#if defined(HL_VK_DEBUG_MEM)
debug(nullptr) << "VulkanMemoryAllocator: Destroying allocator ("
Expand Down
Loading