From 2243c434497faab9b953f11500f87ac5e4c23f7f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 31 Jul 2020 02:59:12 -0700 Subject: [PATCH] kern: fix dynamic calculation of slab heap size --- libmesosphere/source/init/kern_init_slab_setup.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libmesosphere/source/init/kern_init_slab_setup.cpp b/libmesosphere/source/init/kern_init_slab_setup.cpp index 01a580c2..5737afea 100644 --- a/libmesosphere/source/init/kern_init_slab_setup.cpp +++ b/libmesosphere/source/init/kern_init_slab_setup.cpp @@ -127,10 +127,14 @@ namespace ams::kern::init { size += util::AlignUp(sizeof(NAME) * (COUNT), alignof(void *)); \ }); - /* NOTE: This can't be used right now because we don't have all these types implemented. */ - /* Once we do, uncomment the following and stop using the hardcoded size. */ + /* Add the size required for each slab. */ FOREACH_SLAB_TYPE(ADD_SLAB_SIZE) + #undef ADD_SLAB_SIZE + + /* Add the reserved size. */ + size += SlabRegionReservedSize; + return size; }