Skip to content

Extend the Non-nullable pointer optimization to handle Option<Bucket<K, V>> #9378

Closed
@bluss

Description

@bluss

The example is from hashmap, where a bucket is: struct Bucket<K,V> { hash: uint, key: K, value: V } and the hashmap keeps a vector of ~[Option<Bucket<K,V>>]

If this were a custom enum, the non-nullable pointer optimization could be used to eliminate the enum tag overhead if either K or V were such a non-nullable type.

Extend the optimization to handle a case like Option<Bucket> when possible.

Manual cusom enum was implemented in PR #9212 (not merged).

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