Skip to content

Commit

Permalink
fix(mem): correctly allocate colored pages
Browse files Browse the repository at this point in the history
See issue bao-project#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 0eea55e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/mmu/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool pp_alloc_clr(struct page_pool* pool, size_t n, colormap_t colors, struct pp
index = pp_next_clr(pool->base, ++index, colors);
}

index++;

}

if (allocated == n) {
Expand All @@ -158,7 +158,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 0eea55e

Please sign in to comment.