Browse Source

Make stack bigger by default

Add a Cargo feature to allow users to set the stack size if desired, but
default to 2MB to handle more use cases.
pull/59/head
Ian Chamberlain 3 years ago
parent
commit
3cff0c2a77
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 3
      ctru-rs/Cargo.toml
  2. 4
      ctru-rs/src/lib.rs

3
ctru-rs/Cargo.toml

@ -32,8 +32,9 @@ tokio = { version = "1.16", features = ["rt", "time", "sync", "macros"] }
cfg-if = "1.0.0" cfg-if = "1.0.0"
[features] [features]
default = ["romfs"] default = ["romfs", "big-stack"]
romfs = [] romfs = []
big-stack = []
[package.metadata.cargo-3ds] [package.metadata.cargo-3ds]
romfs_dir = "examples/romfs" romfs_dir = "examples/romfs"

4
ctru-rs/src/lib.rs

@ -10,6 +10,10 @@ extern "C" fn services_deinit() {
} }
} }
#[no_mangle]
#[cfg(feature = "big-stack")]
static __stacksize__: usize = 2 * 1024 * 1024; // 2MB
/// Call this somewhere to force Rust to link some required crates /// Call this somewhere to force Rust to link some required crates
/// This is also a setup for some crate integration only available at runtime /// This is also a setup for some crate integration only available at runtime
/// ///

Loading…
Cancel
Save