aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-01-11 12:37:15 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-01-11 12:37:15 +0000
commiteb90cf9114c07234eddfa2ae03369860e4e9a1d4 (patch)
treea068e3eb78f491498b270f3644f0f14cd0bfdd22 /searchlib
parent1a9cab29819cfe54d2020f26917d8c76e16c27b6 (diff)
Detect when size classes are changed instead.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/docstore/value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/value.cpp b/searchlib/src/vespa/searchlib/docstore/value.cpp
index 6f665fdc009..09725b447cd 100644
--- a/searchlib/src/vespa/searchlib/docstore/value.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/value.cpp
@@ -46,7 +46,7 @@ namespace {
vespalib::alloc::Alloc
compact(size_t sz, vespalib::alloc::Alloc buf) {
- if (sz <= (buf.size() << 2)) {
+ if (vespalib::roundUp2inN(sz) < vespalib::roundUp2inN(buf.size())) {
vespalib::alloc::Alloc shrunk = buf.create(sz);
memcpy(shrunk.get(), buf.get(), sz);
return shrunk;