Skip to content

Conversation

FenrirWolf
Copy link
Member

This PR changes the panic hook so that it creates the error app config ahead of time and then performs no further allocations upon invocation. Or at least no extra allocations on the ctru-rs side of things; no idea if there are extra allocations that happen when calling the applet or unwinding the stack, but we don't have control over those things anyway.

use std::fmt::Write;
use std::sync::{Mutex, TryLockError};

static ERROR_CONF: Mutex<errorConf> = unsafe { Mutex::new(std::mem::zeroed()) };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo this static should be exposed somewhere so other users of ctru-rs can use it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants