mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-23 02:42:09 +00:00
Stratosphere: Give more memory to SYSTEM, use less memory.
This commit is contained in:
parent
054c65dffb
commit
9d0d9d95e1
4 changed files with 11 additions and 3 deletions
|
@ -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];
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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))) {
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue