Skip to content

Commit 2c83e79

Browse files
committed
oh no a binary size regression this is bad
1 parent c31ea5b commit 2c83e79

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/backtrace/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ pub fn trace<F: FnMut(&Frame) -> bool>(cb: F) {
6363
///
6464
/// See information on `trace` for caveats on `cb` panicking.
6565
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+
};
6673
trace_imp(&mut cb)
6774
}
6875

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ impl Drop for Bomb {
154154
}
155155
}
156156

157+
#[used]
158+
pub static CRITICALLY_IMPORTANT: [u8; 1024*1024] = [0; 1024*1024];
159+
157160
#[allow(dead_code)]
158161
#[cfg(feature = "std")]
159162
mod lock {

0 commit comments

Comments
 (0)