Skip to content

Possible niche optimization #2

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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