From fdc8b2e75d7a0dbc64e8faf8e4ebfcfbe20abd56 Mon Sep 17 00:00:00 2001 From: Jakub Dabek Date: Fri, 9 Feb 2024 16:37:35 +0100 Subject: [PATCH] vmh: fix same size block allocation When allocating non continuously if exact block size was allocated on given physical allocator it would fail. Fix logic to accomodate that event. Signed-off-by: Jakub Dabek --- zephyr/lib/regions_mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/lib/regions_mm.c b/zephyr/lib/regions_mm.c index 2ee151ac9ed9..e901d7231543 100644 --- a/zephyr/lib/regions_mm.c +++ b/zephyr/lib/regions_mm.c @@ -284,7 +284,7 @@ void *vmh_alloc(struct vmh_heap *heap, uint32_t alloc_size) allocation_error_code = sys_mem_blocks_alloc_contiguous( heap->physical_blocks_allocators[mem_block_iterator], block_count, &ptr); - } else if (block_size > alloc_size) { + } else if (block_size >= alloc_size) { allocation_error_code = sys_mem_blocks_alloc( heap->physical_blocks_allocators[mem_block_iterator], block_count, &ptr);