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

GEODE-8756: Fix CacheableString::objectSize #764

Closed
wants to merge 1 commit into from

Conversation

gaussianrecurrence
Copy link
Contributor

  • objectSize was not taking into account null-terminator character,
    which as of C++11, as stated in § 21.4.7.1, should be included at
    the end of the same string character sequence.
  • Also, in those cases in which SSO applied, the returned size was
    higher than the actual one.
  • A parametrized UT was added to check objectSize is returning the
    right size. Note that no fixed sizes are part of such test, given
    that each std::string implementation could have a different SSO
    size.
  • Added a new class called size_tracking_allocator, which is a custom
    allocator used to track the size STL objects.

  - objectSize was not taking into account null-terminator character,
    which as of C++11, as stated in § 21.4.7.1, should be included at
    the end of the same string character sequence.
  - Also, in those cases in which SSO applied, the returned size was
    higher than the actual one.
  - A parametrized UT was added to check objectSize is returning the
    right size. Note that no fixed sizes are part of such test, given
    that each std::string implementation could have a different SSO
    size.
  - Added a new class called size_tracking_allocator, which is a custom
    allocator used to track the size STL objects.
@gaussianrecurrence
Copy link
Contributor Author

As STL objects depends directly on which specific implementation is choosen, and there is no standarization regarding it, sadly there is no way to guarantee that introducing this change won't blow up in the future. Closing the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant