Skip to content

allow opting out of garbage collection overhead #11425

Closed
@thestinger

Description

@thestinger

Rust currently imposes overhead on all compiled code to accommodate managed pointers and will need to continue doing so to some extent for a real garbage collector. Trait objects and closures are opaque, and may contain garbage collected boxes. Support for correctly rooting references may involve overhead even for unique pointers without managed data inside.

  • closures currently have a 4-word header which is unnecessary
  • procs currently have a 4-word header including a TyDesc, which should just be a destructor pointer
  • &Trait has a TyDesc, which is unnecessary
  • ~Trait has a TyDesc, which should just be a destructor pointer
  • free glue is unnecessary, and should just be drop glue
  • take glue is unnecessary
  • any future support for tracing (shadow stack, references inside unique pointers, etc.) should be entirely disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions