Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • librsvg librsvg
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 200
    • Issues 200
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • librsvglibrsvg
  • Merge requests
  • !801

Reduce binary size a bit; remove ElementInner<T>

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Federico Mena Quintero requested to merge federico/librsvg:reduce-element-generics into main Feb 27, 2023
  • Overview 1
  • Commits 6
  • Pipelines 3
  • Changes 33

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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: reduce-element-generics