Skip to content

Commit 081b94e

Browse files
committed
Add optimize(size) to some particularly large functions
1 parent a23c08c commit 081b94e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/as-if-std/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// submodule into the standard library. We try to set this crate up similarly
33
// to the standard library itself to minimize the likelihood of issues when
44
// updating the `backtrace` crate.
5-
5+
#![feature(optimize_attribute)]
66
#![no_std]
77

88
extern crate alloc;

src/symbolize/gimli.rs

+4
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ struct Context<'a> {
114114
}
115115

116116
impl<'data> Context<'data> {
117+
// #[feature(optimize_attr)] is enabled when we're built inside libstd
118+
#[cfg_attr(backtrace_in_libstd, optimize(size))]
117119
fn new(
118120
stash: &'data Stash,
119121
object: Object<'data>,
@@ -355,6 +357,8 @@ impl Cache {
355357
}
356358

357359
// unsafe because this is required to be externally synchronized
360+
// #[feature(optimize_attr)] is enabled when we're built inside libstd
361+
#[cfg_attr(backtrace_in_libstd, optimize(size))]
358362
unsafe fn with_global(f: impl FnOnce(&mut Self)) {
359363
// A very small, very simple LRU cache for debug info mappings.
360364
//

0 commit comments

Comments
 (0)