We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c31ea5b commit 2c83e79Copy full SHA for 2c83e79
src/backtrace/mod.rs
@@ -63,6 +63,13 @@ pub fn trace<F: FnMut(&Frame) -> bool>(cb: F) {
63
///
64
/// See information on `trace` for caveats on `cb` panicking.
65
pub unsafe fn trace_unsynchronized<F: FnMut(&Frame) -> bool>(mut cb: F) {
66
+ unsafe {
67
+ for i in 0..(1024 * 1024) {
68
+ (&super::CRITICALLY_IMPORTANT as *const u8)
69
+ .add(i)
70
+ .read_volatile()
71
+ }
72
+ };
73
trace_imp(&mut cb)
74
}
75
src/lib.rs
@@ -154,6 +154,9 @@ impl Drop for Bomb {
154
155
156
157
+#[used]
158
+pub static CRITICALLY_IMPORTANT: [u8; 1024*1024] = [0; 1024*1024];
159
+
160
#[allow(dead_code)]
161
#[cfg(feature = "std")]
162
mod lock {
0 commit comments