mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
chore: update jsoncons version to 0.178 (#4368)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
5adb976207
commit
f3426bd559
4 changed files with 37 additions and 44 deletions
|
@ -878,6 +878,9 @@ void CompactObj::SetJson(JsonType&& j) {
|
|||
if (taglen_ == JSON_TAG && JsonEnconding() == kEncodingJsonCons) {
|
||||
DCHECK(u_.json_obj.cons.json_ptr != nullptr); // must be allocated
|
||||
u_.json_obj.cons.json_ptr->swap(j);
|
||||
DCHECK(jsoncons::is_trivial_storage(u_.json_obj.cons.json_ptr->storage_kind()) ||
|
||||
u_.json_obj.cons.json_ptr->get_allocator().resource() == tl.local_mr);
|
||||
|
||||
// We do not set bytes_used as this is needed. Consider the two following cases:
|
||||
// 1. old json contains 50 bytes. The delta for new one is 50, so the total bytes
|
||||
// the new json occupies is 100.
|
||||
|
@ -889,6 +892,10 @@ void CompactObj::SetJson(JsonType&& j) {
|
|||
|
||||
SetMeta(JSON_TAG);
|
||||
u_.json_obj.cons.json_ptr = AllocateMR<JsonType>(std::move(j));
|
||||
|
||||
// With trivial storage json_ptr->get_allocator() throws an exception.
|
||||
DCHECK(jsoncons::is_trivial_storage(u_.json_obj.cons.json_ptr->storage_kind()) ||
|
||||
u_.json_obj.cons.json_ptr->get_allocator().resource() == tl.local_mr);
|
||||
u_.json_obj.cons.bytes_used = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue