fix(heap): Fix the use of block owner macro

In heap_caps_get_info, update the use of block owner
macros to use MULTI_HEAP_BLOCK_OWNER_SIZE() instead of
MULTI_HEAP_ADD_BLOCK_OWNER_SIZE(0).
This commit is contained in:
Guillaume Souchere 2023-12-19 07:07:04 +01:00
parent 980780c2c5
commit b2cc934b94

View File

@ -584,13 +584,13 @@ void heap_caps_get_info( multi_heap_info_t *info, uint32_t caps )
multi_heap_info_t hinfo;
multi_heap_get_info(heap->heap, &hinfo);
info->total_free_bytes += hinfo.total_free_bytes - MULTI_HEAP_ADD_BLOCK_OWNER_SIZE(0);
info->total_free_bytes += hinfo.total_free_bytes - MULTI_HEAP_BLOCK_OWNER_SIZE();
info->total_allocated_bytes += (hinfo.total_allocated_bytes -
hinfo.allocated_blocks * MULTI_HEAP_ADD_BLOCK_OWNER_SIZE(0));
hinfo.allocated_blocks * MULTI_HEAP_BLOCK_OWNER_SIZE());
info->largest_free_block = MAX(info->largest_free_block,
hinfo.largest_free_block);
info->largest_free_block -= info->largest_free_block ? MULTI_HEAP_ADD_BLOCK_OWNER_SIZE(0) : 0;
info->minimum_free_bytes += hinfo.minimum_free_bytes - MULTI_HEAP_ADD_BLOCK_OWNER_SIZE(0);
info->largest_free_block -= info->largest_free_block ? MULTI_HEAP_BLOCK_OWNER_SIZE() : 0;
info->minimum_free_bytes += hinfo.minimum_free_bytes - MULTI_HEAP_BLOCK_OWNER_SIZE();
info->allocated_blocks += hinfo.allocated_blocks;
info->free_blocks += hinfo.free_blocks;
info->total_blocks += hinfo.total_blocks;