Skip to content

Conversation

@dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Nov 29, 2025

Relevant to #6137

  1. Half of SmallStr code assumed values could be less than kPrefLen, half of it asserted it, parts would've just broke. I kept at DCHECK at assign and simplified all other parts
  2. For some reason, if the length of a new string is greater than the current small str, we just decided to pick a raw allocated (robj) string instead, even if it would fit into a reallocated small string
  3. Simplified CompactObj::GetString() part with encodings

Comment on lines -1591 to -1595
tl.small_str_bytes += u_.small_str.Assign(encoded);
return;
}

if (taglen_ == SMALL_TAG && encoded.size() <= u_.small_str.size()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the part with encoded.size() <= u_.small_str.size()

@dranikpg dranikpg requested a review from BorysTheDev December 1, 2025 17:58
@dranikpg dranikpg marked this pull request as ready for review December 1, 2025 17:58
Copy link
Contributor

@BorysTheDev BorysTheDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand a lot, ask somebody else to review too

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