vk: alolcator: report pool allocation failures correctly

Returning `0` instead of `ALO_ALLOC_FAILED` let to API consumers believe that allocation was successful. This lead to asserts failing when trying to free such allocations.

Makes #562 not crash (but miss studio models anyway)
This commit is contained in:
Ivan 'provod' Avdeev 2023-09-14 13:42:47 -04:00
parent 3333d03a7b
commit 7d115168ae
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ static int splitBlockAt(pool_t *blocks, int index, alo_size_t at) {
}
alo_block_t aloPoolAllocate(struct alo_pool_s* pool, alo_size_t size, alo_size_t alignment) {
alo_block_t ret = {0};
alo_block_t ret = {.offset = ALO_ALLOC_FAILED};
block_t *b;
alignment = alignment > pool->min_alignment ? alignment : pool->min_alignment;
for (int i = pool->first_block; i >= 0; i = b->next) {