Skip to content

enums should be optimized to nullable or tagged pointers when possible #5025

Closed
@thestinger

Description

@thestinger

Any enums resembling Option<~T> (a pointer and an empty variant) should be optimized to a nullable pointer. This would really help for linked containers (trees, tries, linked lists).

Additionally, there's a fair bit of space that can be used inside the pointer itself for storing the discriminant due to alignment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions