mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
kern: fix dynamic calculation of slab heap size
This commit is contained in:
parent
5c4fbf5c67
commit
8cd81b3092
2 changed files with 7 additions and 3 deletions
|
@ -127,10 +127,14 @@ namespace ams::kern::init {
|
||||||
size += util::AlignUp(sizeof(NAME) * (COUNT), alignof(void *)); \
|
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. */
|
/* Add the size required for each slab. */
|
||||||
/* Once we do, uncomment the following and stop using the hardcoded size. */
|
|
||||||
FOREACH_SLAB_TYPE(ADD_SLAB_SIZE)
|
FOREACH_SLAB_TYPE(ADD_SLAB_SIZE)
|
||||||
|
|
||||||
|
#undef ADD_SLAB_SIZE
|
||||||
|
|
||||||
|
/* Add the reserved size. */
|
||||||
|
size += SlabRegionReservedSize;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ namespace ams::kern::init {
|
||||||
const size_t resource_region_size = GetResourceRegionSize();
|
const size_t resource_region_size = GetResourceRegionSize();
|
||||||
|
|
||||||
/* Determine the size of the slab region. */
|
/* Determine the size of the slab region. */
|
||||||
const size_t slab_region_size = CalculateTotalSlabHeapSize();
|
const size_t slab_region_size = util::AlignUp(CalculateTotalSlabHeapSize(), PageSize);
|
||||||
MESOSPHERE_INIT_ABORT_UNLESS(slab_region_size <= resource_region_size);
|
MESOSPHERE_INIT_ABORT_UNLESS(slab_region_size <= resource_region_size);
|
||||||
|
|
||||||
/* Setup the slab region. */
|
/* Setup the slab region. */
|
||||||
|
|
Loading…
Reference in a new issue