mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Inline records of at most 16 bytes into the two-word RecordValue with layout-resolved storage
This commit is contained in:
@@ -481,7 +481,7 @@ impl BorrowTree {
|
||||
pub fn stack_need(&self) -> usize {
|
||||
self.nodes
|
||||
.values()
|
||||
.map(|(handle, _)| handle.layout().map_or(0, |layout| layout.size.next_multiple_of(8)))
|
||||
.map(|(handle, _)| handle.layout().map_or(0, |layout| layout.frame_bytes()))
|
||||
.sum()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -825,7 +825,9 @@ mod node_registry_macros {
|
||||
return Err(ConstructionError::Arity { expected: 1, got: inputs.len() });
|
||||
}
|
||||
let mut inputs = inputs.into_iter();
|
||||
let node = core_types::record::RecordExtract::<$type, _>::new(inputs.next().unwrap().downcast_record::<$type>()?);
|
||||
let edge = inputs.next().unwrap();
|
||||
let layout = edge.layout().ok_or(ConstructionError::MissingLayout)?.clone();
|
||||
let node = core_types::record::RecordExtract::<$type, _>::new(edge.downcast_record::<$type>()?, &layout);
|
||||
Ok(EdgeHandle::new(std::sync::Arc::new(node) as std::sync::Arc<ErasedNode<$type>>))
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user