Skip to content

Commit

Permalink
vmh: fix same size block allocation
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dabekjakub committed Feb 9, 2024
1 parent 3cb4945 commit fdc8b2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zephyr/lib/regions_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fdc8b2e

Please sign in to comment.