Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make String object size configurable #1961

Merged
merged 1 commit into from
Nov 10, 2019

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Nov 9, 2019

SSO length is stored in 7 bits so can be at most 127 chars.
Revise tests to accommodate the largest size.

…the largest size.

SSO length is stored in 7 bits so can be at most 127 chars.
@mikee47
Copy link
Contributor Author

mikee47 commented Nov 9, 2019

Continuing from #1951 the disadvantage of increasing string size is we can't use the space once the String switches out of SSO mode, so the additional allocation becomes an overhead.

One way to solve this is to make SSO_CAPACITY a template parameter so Strings can be defined with different values to suit requirements. That would require String to become a virtual base, however, which adds another 4 bytes to the size.

@slaff slaff added this to the 4.0.1 milestone Nov 10, 2019
@slaff slaff merged commit e62cf72 into SmingHub:develop Nov 10, 2019
@mikee47 mikee47 deleted the feature/tunable-sso branch November 12, 2019 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants