Skip to content

Commit fdc8b2e

Browse files
committed
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 <jakub.dabek@intel.com>
1 parent 3cb4945 commit fdc8b2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zephyr/lib/regions_mm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void *vmh_alloc(struct vmh_heap *heap, uint32_t alloc_size)
284284
allocation_error_code = sys_mem_blocks_alloc_contiguous(
285285
heap->physical_blocks_allocators[mem_block_iterator], block_count,
286286
&ptr);
287-
} else if (block_size > alloc_size) {
287+
} else if (block_size >= alloc_size) {
288288
allocation_error_code = sys_mem_blocks_alloc(
289289
heap->physical_blocks_allocators[mem_block_iterator], block_count,
290290
&ptr);

0 commit comments

Comments
 (0)