-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sstring: add support for non-nul-terminated sstrings
When an sstring is used as a string replacement we need a nul terminator so that c_str() returns a nul-terminated string. However, when we use basic_sstring as a byte container (e.g. Scylla's "bytes" type) the nul terminator is not needed, and only occupies extra space and generates unnecessary instructions. This is especially visible with the buddy allocator and power-of-two sized strings. Fix by providing a new template parameter, NulTerminate, defaulting to true. When false, we do not allocate and use extra space for Nul termination. Message-Id: <20180401151321.14588-1-avi@scylladb.com>
- Loading branch information
Showing
3 changed files
with
54 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters