From ec591bbb54279322c112f8164c2c88dde180ec0f Mon Sep 17 00:00:00 2001 From: Sparchatus Date: Thu, 31 Mar 2022 20:37:44 +0000 Subject: [PATCH] Bugfix for root slot allocator refill as in Q&A Forum https://moodle-app2.let.ethz.ch/mod/forum/discuss.php?d=100538 --- lib/aos/slot_alloc/twolevel_slot_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aos/slot_alloc/twolevel_slot_alloc.c b/lib/aos/slot_alloc/twolevel_slot_alloc.c index 6f87e5d..441c680 100644 --- a/lib/aos/slot_alloc/twolevel_slot_alloc.c +++ b/lib/aos/slot_alloc/twolevel_slot_alloc.c @@ -65,7 +65,7 @@ errval_t two_level_alloc(struct slot_allocator *ca, struct capref *ret) struct slot_allocator *rca = (struct slot_allocator *)(&state->rootca); // Need to refill when one slot left, otherwise it's too late size_t rootcn_free = single_slot_alloc_freecount(&state->rootca); - if (rootcn_free == 1) { + if (rootcn_free <= 2) { // resize root slot allocator (and rootcn) err = root_slot_allocator_refill(NULL, NULL); if (err_is_fail(err)) {