Skip to content

Commit

Permalink
fix(mem): correctly allocate colored pages
Browse files Browse the repository at this point in the history
See issue #199

Signed-off-by: Nikolai Kosmatov <[email protected]>
Signed-off-by: Jose Martins <[email protected]>
  • Loading branch information
nkosmatov authored and josecm committed Jan 6, 2025
1 parent 269f5bc commit 56ad2a4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/core/mmu/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ bool pp_alloc_clr(struct page_pool* pool, size_t n, colormap_t colors, struct pp
allocated++;
index = pp_next_clr(pool->base, ++index, colors);
}

index++;
}

if (allocated == n) {
Expand All @@ -158,7 +156,7 @@ bool pp_alloc_clr(struct page_pool* pool, size_t n, colormap_t colors, struct pp
* If this is the first iteration, setup index and top to search from base of the page
* pool until the previous iteration start point
*/
index = 0;
index = pp_next_clr(pool->base, 0, colors);
}
}

Expand Down

0 comments on commit 56ad2a4

Please sign in to comment.