Shrink the size of ClosureTypeInfo to fit into 64 bytes again

This commit is contained in:
Oli Scherer
2024-03-07 12:27:58 +00:00
parent 2f2350e577
commit ba5f0418af
3 changed files with 25 additions and 9 deletions

View File

@@ -338,7 +338,8 @@ macro_rules! define_callbacks {
pub type Storage<'tcx> = <$($K)* as keys::Key>::Cache<Erase<$V>>;
// Ensure that keys grow no larger than 72 bytes
// Ensure that keys grow no larger than 72 bytes by accident.
// Increase this limit if necessary, but do try to keep the size low if possible
#[cfg(all(any(target_arch = "x86_64", target_arch="aarch64"), target_pointer_width = "64"))]
const _: () = {
if mem::size_of::<Key<'static>>() > 72 {
@@ -352,10 +353,11 @@ macro_rules! define_callbacks {
}
};
// Ensure that values grow no larger than 72 bytes
// Ensure that values grow no larger than 64 bytes by accident.
// Increase this limit if necessary, but do try to keep the size low if possible
#[cfg(all(any(target_arch = "x86_64", target_arch="aarch64"), target_pointer_width = "64"))]
const _: () = {
if mem::size_of::<Value<'static>>() > 72 {
if mem::size_of::<Value<'static>>() > 64 {
panic!("{}", concat!(
"the query `",
stringify!($name),