We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 178aa39 commit a524391Copy full SHA for a524391
src/core/small_string.cc
@@ -59,7 +59,8 @@ size_t SmallString::Assign(std::string_view s) {
59
DCHECK(CanAllocate(s.size()));
60
uint8_t* realptr = nullptr;
61
62
- // If the allocation is large enough and space efficient, we can avoid allocating
+ // reallocate if we need a larger allocation or it becomes space-inefficient
63
+ // TODO: check if mi_usable_size is has space before growing (like listpack)
64
if (s.size() >= size_ || s.size() * 2 < MallocUsed()) {
65
Free();
66
0 commit comments