This replaces ElementInner<T>
with a version without generics:
-
enum NodeData
has boxed variants now, so elements don't allocate as much asNodeData::Text(Chars)
. -
struct Element
has the element's name, attributes, etc. now, and anelement_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.