mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix: configure jsonconst double parser to use std::from_chars (#4360)
The problem: apparently, jsoncons uses strtod by default when parsing doubles. On some platforms (alpine/musl) this function uses lots of stack, which potentially can lead to stack corruption. This PR configures jsoncons to use std::from_chars that is more efficient and less stack hungry. The single include point to consume jsoncons/json.hpp should be "core/json_object.h" Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
95cd9dfb4c
commit
01f24da2b6
8 changed files with 19 additions and 17 deletions
|
@ -9,12 +9,6 @@
|
|||
#include <absl/strings/str_join.h>
|
||||
#include <absl/strings/str_split.h>
|
||||
|
||||
#include <jsoncons/json.hpp>
|
||||
#include <jsoncons_ext/jsonpatch/jsonpatch.hpp>
|
||||
#include <jsoncons_ext/jsonpath/jsonpath.hpp>
|
||||
#include <jsoncons_ext/jsonpointer/jsonpointer.hpp>
|
||||
#include <jsoncons_ext/mergepatch/mergepatch.hpp>
|
||||
|
||||
#include "absl/cleanup/cleanup.h"
|
||||
#include "base/flags.h"
|
||||
#include "base/logging.h"
|
||||
|
@ -36,6 +30,12 @@
|
|||
#include "server/tiered_storage.h"
|
||||
#include "server/transaction.h"
|
||||
|
||||
// clang-format off
|
||||
#include <jsoncons_ext/jsonpatch/jsonpatch.hpp>
|
||||
#include <jsoncons_ext/jsonpointer/jsonpointer.hpp>
|
||||
#include <jsoncons_ext/mergepatch/mergepatch.hpp>
|
||||
// clang-format on
|
||||
|
||||
ABSL_FLAG(bool, jsonpathv2, true,
|
||||
"If true uses Dragonfly jsonpath implementation, "
|
||||
"otherwise uses legacy jsoncons implementation.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue