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

Reclaim one byte from HeaderString. #6826

Merged

Commits on May 7, 2019

  1. Reclaim one byte from HeaderString.

    With conversion to getStringView() access there is no longer any need to
    reserve a NUL byte at the end of the HeaderString since all accesses
    will be through string_views which are not required to be NUL
    terminated.
    
    Ran bazel test -c opt //test/... --config=asan --runs_per_test=10
    without issue. There is some risk that someone has or will abuse the
    data() accessor on a string_view assuming it is NUL terminated. A
    comment is added to emphasize that the HeaderString::getStringView() is
    not NUL terminated.
    
    By eliminating this wasted byte it is more likely that a HeaderString
    will fit into the existing embedded space, hopefully giving a small
    performance gain and reduction in memory allocations.
    
    Signed-off-by: Dan Noé <dpn@google.com>
    dnoe committed May 7, 2019
    Configuration menu
    Copy the full SHA
    87df61c View commit details
    Browse the repository at this point in the history
  2. Get rid of one more +1

    Signed-off-by: Dan Noé <dpn@google.com>
    dnoe committed May 7, 2019
    Configuration menu
    Copy the full SHA
    16c6604 View commit details
    Browse the repository at this point in the history