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:
Roman Gershman 2024-12-24 04:02:50 +02:00 committed by GitHub
parent 95cd9dfb4c
commit 01f24da2b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 19 additions and 17 deletions

View file

@ -20,8 +20,6 @@ extern "C" {
#include <absl/strings/str_cat.h>
#include <absl/strings/strip.h>
#include <jsoncons/json.hpp>
#include "base/flags.h"
#include "base/logging.h"
#include "base/pod_array.h"