mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-23 10:52:13 +00:00
0.8.3: fix some memory/deadlock issues
This commit is contained in:
parent
5b1bb71787
commit
cedbcba3e3
2 changed files with 14 additions and 11 deletions
|
@ -62,6 +62,11 @@ void __appInit(void) {
|
||||||
fatalSimple(MAKERESULT(Module_Libnx, LibnxError_InitFail_SM));
|
fatalSimple(MAKERESULT(Module_Libnx, LibnxError_InitFail_SM));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = fsInitialize();
|
||||||
|
if (R_FAILED(rc)) {
|
||||||
|
fatalSimple(MAKERESULT(Module_Libnx, LibnxError_InitFail_FS));
|
||||||
|
}
|
||||||
|
|
||||||
CheckAtmosphereVersion(CURRENT_ATMOSPHERE_VERSION);
|
CheckAtmosphereVersion(CURRENT_ATMOSPHERE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,14 +94,6 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
/* Create fsp-srv mitm. */
|
/* Create fsp-srv mitm. */
|
||||||
AddMitmServerToManager<FsMitmService>(server_manager, "fsp-srv", 61);
|
AddMitmServerToManager<FsMitmService>(server_manager, "fsp-srv", 61);
|
||||||
|
|
||||||
/* Connect to FS */
|
|
||||||
{
|
|
||||||
Result rc = fsInitialize();
|
|
||||||
if (R_FAILED(rc)) {
|
|
||||||
fatalSimple(MAKERESULT(Module_Libnx, LibnxError_InitFail_FS));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (R_FAILED(threadCreate(&sd_initializer_thread, &Utils::InitializeSdThreadFunc, NULL, 0x4000, 0x15, 0))) {
|
if (R_FAILED(threadCreate(&sd_initializer_thread, &Utils::InitializeSdThreadFunc, NULL, 0x4000, 0x15, 0))) {
|
||||||
/* TODO: Panic. */
|
/* TODO: Panic. */
|
||||||
|
|
|
@ -179,11 +179,17 @@ void ResourceLimitUtils::InitializeLimits() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Atmosphere: Allocate extra memory (24 MiB) to SYSTEM away from Application. */
|
/* Atmosphere: Allocate extra memory (24 MiB) to SYSTEM away from Applet. */
|
||||||
for (unsigned int i = 0; i < 6; i++) {
|
for (unsigned int i = 0; i < 6; i++) {
|
||||||
g_memory_resource_limits[i][0] += ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
|
g_memory_resource_limits[i][0] += ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
|
||||||
/* Taking from application instead of applet fixes a rare hang on boot on < 4.0.0. */
|
/* On < 4.0.0, taking from application instead of applet fixes a rare hang on boot. */
|
||||||
g_memory_resource_limits[i][1] -= ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
|
if (kernelAbove600()) {
|
||||||
|
g_memory_resource_limits[i][1] -= ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
|
||||||
|
} else if (kernelAbove400()) {
|
||||||
|
g_memory_resource_limits[i][2] -= ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
|
||||||
|
} else {
|
||||||
|
g_memory_resource_limits[i][1] -= ATMOSPHERE_EXTRA_SYSTEM_MEMORY_FOR_SYSMODULES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set resource limits. */
|
/* Set resource limits. */
|
||||||
|
|
Loading…
Reference in a new issue