-
Notifications
You must be signed in to change notification settings - Fork 131
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
Support storing trailing \0 byte at the end of string #187
Comments
Correct. Currently It is, however, not that hard to trick cista/include/cista/containers/string.h Line 341 in 0a7a784
|
Consider an idea of automatic "null-terminator with size" for small-string optimization (by Andrei Alexandrescu): With a little bit of "mixing" and use it as could be embedded for non small-string (adding extra 4/8 bytes at the end for size/null-terminator, as above). This will help to use |
That technique makes sense. Currently, the Overall I think it makes sense to write a new generic class, that can work as a However, currently I am busy with another project. So don't expect this to happen very soon (this also applies to the other issues you opened which would probably also benefit from this change). |
Thank you for your analysis, I appreciate your insights. |
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by felixguendling#187 (comment). See felixguendling#187.
This new type is able to store a trailing \0 character, without compromising one byte for storage when the string is a small-string. Storage of NUL character within data is also supported. This is inspired by #187 (comment). See #187.
@khng300 Wow, superb work! I will be conducting comprehensive tests on my end throughout the weekend. |
Hi, not sure if I miss anything but I recently discovered cista::generic_string did not store the \0 byte at the end of a long string (or string that just hit the short_length_limit length limit). As a workaround I currently draft my own string type for the purpose.
Is there any plan to work this out? Or do we need to propose a new type?
(Not really related but just a side-topic: What about support storing \0 within the content of a short string?)
The text was updated successfully, but these errors were encountered: