Skip to content

Possible niche optimization #2

@fgardt

Description

@fgardt

It's possible to get Option<ColdString> to be the same size as ColdString by informing the compiler about the available niche of 0 (unless I missed something and 0 is a valid value?).

Can be achieved just by changing

pub struct ColdString([u8; WIDTH]);

to

pub struct ColdString {
    ptr: NonNull<usize>,
}

And then updating all other areas accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions