* feat: copy frameworks to Frameworks folder * add dylib linking to patching * remove logging * rename __aslr_offset * fix android/linux * support linker flavor * support custom target dirs * custom cargo target dir support * whoops ios * dlsym doesn't exist on windows * look for the right main symbol per platform * distinction between mains * export main on windows * enbable rlib caching * add dx hash * adjust linking warnings * update tui with hotreload state * implement symbol flags * add flags * only run ranlib on darwin * enable lld * paths * add harness test for tls * wip: revert launch mobile * wip * fix fullstack mobile * fix a few bugs - long paths? - reverting back to original * pass-thru fuse-ld args * fix nan in render, fix empty archives * consider existing dep files if archive exists * fmt * drop msrv
26 lines
589 B
Rust
26 lines
589 B
Rust
pub use std::cell::Cell;
|
|
use std::{cell::RefCell, thread::LocalKey};
|
|
|
|
#[derive(Debug)]
|
|
pub struct StoredItem {
|
|
pub name: String,
|
|
pub value: f32,
|
|
pub items: Vec<String>,
|
|
}
|
|
|
|
thread_local! {
|
|
pub static BAZ: RefCell<Option<StoredItem>> = const { RefCell::new(None) };
|
|
}
|
|
|
|
pub fn get_baz() -> &'static LocalKey<RefCell<Option<StoredItem>>> {
|
|
if BAZ.with(|f| f.borrow().is_none()) {
|
|
BAZ.set(Some(StoredItem {
|
|
name: "BAR".to_string(),
|
|
value: 0.0,
|
|
items: vec!["item1".to_string(), "item2".to_string()],
|
|
}));
|
|
}
|
|
|
|
&BAZ
|
|
}
|