mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-20 18:05:11 -04:00
Results: Implement namespaced, type-safe results.
Because I was working on multiple things at once, this commit also: - Adds wrappers for/linker flags to wrap CXX exceptions to make them abort. This saves ~0x8000 of memory in every system module. - Broadly replaces lines of the pattern if (cond) { return ResultX; } with R_UNLESS(!cond, ResultX());. - Reworks the R_TRY_CATCH macros (and the result macros in general).
This commit is contained in:
parent
15773e4755
commit
4059dc6187
169 changed files with 2172 additions and 1868 deletions
|
@ -142,17 +142,14 @@ namespace sts::boot2 {
|
|||
void LaunchTitle(os::ProcessId *out_process_id, const ncm::TitleLocation &loc, u32 launch_flags) {
|
||||
os::ProcessId process_id = os::InvalidProcessId;
|
||||
|
||||
switch (pm::shell::LaunchTitle(&process_id, loc, launch_flags)) {
|
||||
case ResultKernelResourceExhausted:
|
||||
case ResultKernelOutOfMemory:
|
||||
case ResultKernelLimitReached:
|
||||
STS_ASSERT(false);
|
||||
default:
|
||||
/* We don't care about other issues. */
|
||||
break;
|
||||
/* Launch, lightly validate result. */
|
||||
{
|
||||
const auto launch_result = pm::shell::LaunchTitle(&process_id, loc, launch_flags);
|
||||
STS_ASSERT(!(svc::ResultOutOfResource::Includes(launch_result)));
|
||||
STS_ASSERT(!(svc::ResultOutOfMemory::Includes(launch_result)));
|
||||
STS_ASSERT(!(svc::ResultLimitReached::Includes(launch_result)));
|
||||
}
|
||||
|
||||
|
||||
if (out_process_id) {
|
||||
*out_process_id = process_id;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue