diff --git a/node-graph/libraries/graphic-types/src/graphic.rs b/node-graph/libraries/graphic-types/src/graphic.rs index cbee1472d1..039ff3d111 100644 --- a/node-graph/libraries/graphic-types/src/graphic.rs +++ b/node-graph/libraries/graphic-types/src/graphic.rs @@ -1835,7 +1835,7 @@ mod run_tests { }; // SAFETY: the list serves only while `persistent` is live, and the // promote under test replaces every borrow it carries. - let (paint, _) = transient.alloc(unsafe { core_types::record::erase_static(published) }).unwrap(); + let (paint, _) = transient.alloc_sized_keyed(unsafe { core_types::record::erase_static(published) }, 0).unwrap(); let occupied = persistent.occupancy(); let (layout, span, _frames) = promote_paint_field(Some(paint), 1, &transient, &persistent); @@ -1859,7 +1859,7 @@ mod run_tests { let Some(Graphic::Vector(vector)) = paint.element(0) else { panic!("the paint carries a vector") }; vector.point_domain.positions().as_ptr() }; - let (paint, _) = transient.alloc(paint).unwrap(); + let (paint, _) = transient.alloc_sized_keyed(paint, 0).unwrap(); let (layout, span, _frames) = promote_paint_field(Some(paint), 2, &transient, &persistent); let served = promoted_paint(&span, &layout, 0, &persistent); diff --git a/node-graph/nodes/graphic/src/graphic.rs b/node-graph/nodes/graphic/src/graphic.rs index 5a734cc85e..9f156890b1 100644 --- a/node-graph/nodes/graphic/src/graphic.rs +++ b/node-graph/nodes/graphic/src/graphic.rs @@ -214,7 +214,7 @@ where }; let park_paint = |paint: Option>>| -> Result>>, Interrupt> { match paint { - Some(paint) => Ok(Some(arena.alloc(paint).ok_or_else(exhausted)?.0)), + Some(paint) => Ok(Some(arena.alloc_sized_keyed(paint, 0).ok_or_else(exhausted)?.0)), None => Ok(None), } }; diff --git a/node-graph/nodes/path-bool/src/lib.rs b/node-graph/nodes/path-bool/src/lib.rs index 538eb1985d..9a828a5cd0 100644 --- a/node-graph/nodes/path-bool/src/lib.rs +++ b/node-graph/nodes/path-bool/src/lib.rs @@ -69,7 +69,7 @@ fn boolean_core<'e>( }; let park_paint = |paint: Option>>| -> Result>, core_types::gpoll::Interrupt> { match paint { - Some(list) => Ok(Some(arena.alloc(list).ok_or_else(exhausted)?.0)), + Some(list) => Ok(Some(arena.alloc_sized_keyed(list, 0).ok_or_else(exhausted)?.0)), None => Ok(None), } }; @@ -82,7 +82,7 @@ fn boolean_core<'e>( let layer_path = arena.alloc(layer_path).ok_or_else(exhausted)?.0; // Snapshot the input layers so the renderer can recurse into them for // editor click-target preservation. - let merged_layers = arena.alloc(snapshot).ok_or_else(exhausted)?.0; + let merged_layers = arena.alloc_sized_keyed(snapshot, 0).ok_or_else(exhausted)?.0; Ok(( element, diff --git a/node-graph/nodes/vector/src/vector_nodes.rs b/node-graph/nodes/vector/src/vector_nodes.rs index 5dbf982820..3961d95cf5 100644 --- a/node-graph/nodes/vector/src/vector_nodes.rs +++ b/node-graph/nodes/vector/src/vector_nodes.rs @@ -276,8 +276,10 @@ fn assign_colors_graphic_extent( pub use _assign_colors_graphic_mod::assign_colors_graphic_entries; +/// Keyed, so a group-free paint's promote moves this header rather than +/// cloning the content it owns. fn park_paint<'e>(arena: &'e core_types::arena::Arena, paint: List>) -> Result<&'e List>, Interrupt> { - let (parked, _) = arena.alloc(paint).ok_or(GraphError { + let (parked, _) = arena.alloc_sized_keyed(paint, 0).ok_or(GraphError { kind: core_types::gpoll::ErrorKind::ArenaExhausted, trace: Vec::new(), })?; @@ -1555,7 +1557,7 @@ fn emit_legacy_lane<'e>( let merged_layers = output .attribute::>>(ATTR_EDITOR_MERGED_LAYERS, lane) .and_then(|layers| layers.as_ref()) - .map(|layers| arena.alloc(layers.clone()).ok_or_else(exhausted).map(|(parked, _)| parked)) + .map(|layers| arena.alloc_sized_keyed(layers.clone(), 0).ok_or_else(exhausted).map(|(parked, _)| parked)) .transpose()?; Ok(( @@ -1884,7 +1886,7 @@ fn flatten_path_core<'e>( let layer_path = arena.alloc(layer_path).ok_or_else(exhausted)?.0; // Snapshot the input layers so the renderer can recurse into them for // editor click-target preservation, as the boolean operation does. - let merged_layers = arena.alloc(snapshot).ok_or_else(exhausted)?.0; + let merged_layers = arena.alloc_sized_keyed(snapshot, 0).ok_or_else(exhausted)?.0; Ok((output, Attr(DAffine2::IDENTITY), Attr(fill), Attr(stroke), Attr(layer_path.as_slice()), Attr(Some(merged_layers)))) }