1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-05 19:51:45 +00:00

Stratosphere: Give more memory to SYSTEM, use less memory.

This commit is contained in:
Michael Scire 2018-07-27 01:44:21 -07:00
parent 054c65dffb
commit 9d0d9d95e1
4 changed files with 11 additions and 3 deletions

View file

@ -16,7 +16,7 @@ extern "C" {
u32 __nx_applet_type = AppletType_None;
#define INNER_HEAP_SIZE 0x200000
#define INNER_HEAP_SIZE 0x20000
size_t nx_inner_heap_size = INNER_HEAP_SIZE;
char nx_inner_heap[INNER_HEAP_SIZE];

View file

@ -18,7 +18,7 @@ extern "C" {
u32 __nx_applet_type = AppletType_None;
#define INNER_HEAP_SIZE 0x200000
#define INNER_HEAP_SIZE 0x20000
size_t nx_inner_heap_size = INNER_HEAP_SIZE;
char nx_inner_heap[INNER_HEAP_SIZE];

View file

@ -3,6 +3,9 @@
#include "pm_resource_limits.hpp"
/* Give 24 MiB to SYSTEM from Applet. This allows for more custom sysmodules. */
#define ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES 0x1800000ULL
/* Memory that system, application, applet are allowed to allocate. */
static const u64 g_memory_resource_limits_deprecated[5][3] = {
{0x010D00000ULL, 0x0CD500000ULL, 0x021700000ULL},
@ -78,6 +81,11 @@ void ResourceLimitUtils::InitializeLimits() {
memcpy(&g_memory_resource_limits, &g_memory_resource_limits_deprecated, sizeof(g_memory_resource_limits));
memcpy(&g_resource_limits, &g_resource_limits_deprecated, sizeof(g_resource_limits));
}
/* Atmosphere: Allocate extra memory (24 MiB) to SYSTEM away from Applet. */
for (unsigned int i = 0; i < 5; i++) {
g_memory_resource_limits[i][0] += ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
g_memory_resource_limits[i][2] -= ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
}
/* Get memory limits. */
u64 memory_arrangement;
if (R_FAILED(splGetConfig(SplConfigItem_MemoryArrange, &memory_arrangement))) {

View file

@ -15,7 +15,7 @@ extern "C" {
u32 __nx_applet_type = AppletType_None;
#define INNER_HEAP_SIZE 0x200000
#define INNER_HEAP_SIZE 0x20000
size_t nx_inner_heap_size = INNER_HEAP_SIZE;
char nx_inner_heap[INNER_HEAP_SIZE];