mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Un-inline some methods initializing thread_local! …
… in order to limit stack frame sizes after extra inlining from https://github.com/rust-lang/rust/pull/43931 See https://github.com/servo/servo/pull/18420#issuecomment-328769322
This commit is contained in:
parent
7f4cb1861b
commit
0d4168034f
2 changed files with 12 additions and 0 deletions
|
@ -121,6 +121,12 @@ impl<E: TElement> StyleBloom<E> {
|
||||||
/// Create an empty `StyleBloom`. Because StyleBloom acquires the thread-
|
/// Create an empty `StyleBloom`. Because StyleBloom acquires the thread-
|
||||||
/// local filter buffer, creating multiple live StyleBloom instances at
|
/// local filter buffer, creating multiple live StyleBloom instances at
|
||||||
/// the same time on the same thread will panic.
|
/// the same time on the same thread will panic.
|
||||||
|
|
||||||
|
// Forced out of line to limit stack frame sizes after extra inlining from
|
||||||
|
// https://github.com/rust-lang/rust/pull/43931
|
||||||
|
//
|
||||||
|
// See https://github.com/servo/servo/pull/18420#issuecomment-328769322
|
||||||
|
#[inline(never)]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let bloom_arc = BLOOM_KEY.with(|b| b.clone());
|
let bloom_arc = BLOOM_KEY.with(|b| b.clone());
|
||||||
let filter = OwningHandle::new_with_fn(bloom_arc, |x| unsafe { x.as_ref() }.unwrap().borrow_mut());
|
let filter = OwningHandle::new_with_fn(bloom_arc, |x| unsafe { x.as_ref() }.unwrap().borrow_mut());
|
||||||
|
|
|
@ -465,6 +465,12 @@ impl<E: TElement> StyleSharingCandidateCache<E> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new style sharing candidate cache.
|
/// Create a new style sharing candidate cache.
|
||||||
|
|
||||||
|
// Forced out of line to limit stack frame sizes after extra inlining from
|
||||||
|
// https://github.com/rust-lang/rust/pull/43931
|
||||||
|
//
|
||||||
|
// See https://github.com/servo/servo/pull/18420#issuecomment-328769322
|
||||||
|
#[inline(never)]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
assert_eq!(mem::size_of::<SharingCache<E>>(), mem::size_of::<TypelessSharingCache>());
|
assert_eq!(mem::size_of::<SharingCache<E>>(), mem::size_of::<TypelessSharingCache>());
|
||||||
assert_eq!(mem::align_of::<SharingCache<E>>(), mem::align_of::<TypelessSharingCache>());
|
assert_eq!(mem::align_of::<SharingCache<E>>(), mem::align_of::<TypelessSharingCache>());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue