Skip to content

Reduce binary size a bit; remove ElementInner<T>

This replaces ElementInner<T> with a version without generics:

  • enum NodeData has boxed variants now, so elements don't allocate as much as NodeData::Text(Chars).
  • struct Element has the element's name, attributes, etc. now, and an element_data field
  • enum ElementData has boxed concrete types with the element structs (Circle, etc.).

This eliminates monomorphization for all of ElementInner's methods, and with --release yields a savings of about 180000 bytes in the size of rsvg-convert's .text section.

Merge request reports