From ceb0287109c1b44222cad18d470d91e3eb8129b7 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Fri, 19 May 2023 20:13:31 -0400 Subject: [PATCH] slab: fix alignment If the pointer the the beginning of the slab was the beginning of the aligned region, instead of jumping to the next, as was done previously, we use the already aligned pointer instead. --- mem/slab.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mem/slab.c b/mem/slab.c index 85be433..954a4bc 100644 --- a/mem/slab.c +++ b/mem/slab.c @@ -49,6 +49,7 @@ slab_t *slab_create(size_t size, size_t cache_size, uint64_t flags) ret->align = SLAB_ALIGN; } + start -= 1; start |= ret->align; start += 1;