Skip to content

Document interned string location #75

Description

@Caellian

Documentation doesn't specify whether interned string will be moved.

I'm using StringInterner at the moment, but this clarification would be useful for all implementations.

I want to produce Cow<'inerner_owner, str> from strings and am wondering whether inserting new strings can cause their layout to shift.

Example:

  • ["a", ..., "hello", "there", "world"], insert "hello world"
  • ["a", ..., "hello world", "there"]

I'm assuming this isn't the case, but a backend that's optimized for minimal memory footprint could implement such optimizations, so it would be nice for docs to specify whether string position is persistent.

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