From fb83b114efcec4544eba8d45e3c7969ca756c086 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Fri, 3 Apr 2026 15:26:12 -0400 Subject: [PATCH] 4.6.1 --- CMakeLists.txt | 2 +- Doxyfile | 2 +- include/simdjson/simdjson_version.h | 4 ++-- singleheader/simdjson.cpp | 2 +- singleheader/simdjson.h | 23 ++++++++--------------- singleheader/singleheader.zip | Bin 10446879 -> 10446628 bytes 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b887a30d6..c3a1d473b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ endif() project( simdjson # The version number is modified by tools/release.py - VERSION 4.6.0 + VERSION 4.6.1 DESCRIPTION "Parsing gigabytes of JSON per second" HOMEPAGE_URL "https://simdjson.org/" LANGUAGES CXX C diff --git a/Doxyfile b/Doxyfile index 58d350cd7..cf53f7fb7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = simdjson # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "4.6.0" +PROJECT_NUMBER = "4.6.1" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/include/simdjson/simdjson_version.h b/include/simdjson/simdjson_version.h index 9b76a60f9..3b8f0351e 100644 --- a/include/simdjson/simdjson_version.h +++ b/include/simdjson/simdjson_version.h @@ -4,7 +4,7 @@ #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION "4.6.0" +#define SIMDJSON_VERSION "4.6.1" namespace simdjson { enum { @@ -19,7 +19,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 0 + SIMDJSON_VERSION_REVISION = 1 }; } // namespace simdjson diff --git a/singleheader/simdjson.cpp b/singleheader/simdjson.cpp index d3e3cc362..cbcd9f1e6 100644 --- a/singleheader/simdjson.cpp +++ b/singleheader/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2026-03-30 10:16:31 -0400. version 4.6.0 Do not edit! */ +/* auto-generated on 2026-04-03 15:25:03 -0400. version 4.6.1 Do not edit! */ /* including simdjson.cpp: */ /* begin file simdjson.cpp */ #define SIMDJSON_SRC_SIMDJSON_CPP diff --git a/singleheader/simdjson.h b/singleheader/simdjson.h index 79fba5c1f..0a0215313 100644 --- a/singleheader/simdjson.h +++ b/singleheader/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on 2026-03-30 10:16:31 -0400. version 4.6.0 Do not edit! */ +/* auto-generated on 2026-04-03 15:25:03 -0400. version 4.6.1 Do not edit! */ /* including simdjson.h: */ /* begin file simdjson.h */ #ifndef SIMDJSON_H @@ -2538,7 +2538,7 @@ namespace std { #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION "4.6.0" +#define SIMDJSON_VERSION "4.6.1" namespace simdjson { enum { @@ -2553,7 +2553,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 0 + SIMDJSON_VERSION_REVISION = 1 }; } // namespace simdjson @@ -5033,8 +5033,7 @@ inline padded_string padded_string_builder::convert() noexcept { } inline bool padded_string_builder::reserve(size_t additional) noexcept { - // Guard 1: size + additional must not wrap around. - if (simdjson_unlikely(additional > SIZE_MAX - size)) { + if (simdjson_unlikely(additional + size < size)) { return false; // overflow: cannot satisfy request } size_t needed = size + additional; @@ -5045,16 +5044,9 @@ inline bool padded_string_builder::reserve(size_t additional) noexcept { // We are going to grow the capacity exponentially to avoid // repeated allocations. if (new_capacity < 4096) { - // Guard 2: doubling must not wrap around. - if (simdjson_unlikely(new_capacity > SIZE_MAX / 2)) { - return false; // overflow: fall back to exact allocation - } new_capacity *= 2; - } else { - // Guard 3: 1.5x growth must not wrap around. - if (simdjson_unlikely(new_capacity > SIZE_MAX - new_capacity / 2)) { - return false; // overflow: fall back to exact allocation - } + // overflow guard: ensure new_capacity + new_capacity/2 does not overflow + } else if (new_capacity + new_capacity / 2 > new_capacity) { new_capacity += new_capacity / 2; // grow by 1.5x } char *new_data = internal::allocate_padded_buffer(new_capacity); @@ -9506,10 +9498,11 @@ inline bool parser::dump_raw_tape(std::ostream &os) const noexcept { } inline simdjson_result parser::read_file(std::string_view path) noexcept { + const std::string path_copy(path); // Open the file SIMDJSON_PUSH_DISABLE_WARNINGS SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe - std::FILE *fp = std::fopen(path.data(), "rb"); + std::FILE *fp = std::fopen(path_copy.c_str(), "rb"); SIMDJSON_POP_DISABLE_WARNINGS if (fp == nullptr) { diff --git a/singleheader/singleheader.zip b/singleheader/singleheader.zip index 59ff1746d500f8e6b4ec6e7eb9effefee72d0f7f..1e8296232f3db10f61ec2b485a814b16f1933af2 100644 GIT binary patch delta 1005 zcma*m$xqW!5C?EtDj+JzQWh0?w5VYBQnrE!E-2zsK}8X*wf%Kkt!?cB0#-yEtKf#) z&jlqWCLBz>nTDHxf${9!M8d@bH$&pL2MyumOFqfG_vR(@CYjl9%c>7wmsN$1?o3s2 zMtXIOP7L&YYH6GCfe3eG$bhQig@fo3P$4*Nd%=Kr`r{Fx&5(WJYKmq zS>^Y?D%JXgkOEOj_`RZL<@Ks;VG>r+CYu)x>ZH=A2SZBfGfqy)?bDsvM5qi_rya2$G|7f!%QI0b!h8qPpJoP_~62j{^F z7r+G)pG za?r$h^I{s}RWBZlCp{VuCK4|i&nEuSXh4nOOMY{BGx_KLUNZ0Dt8ckIufOFQw{0Ar zJ9$|Dyx7@VQ`7OOuFL2%`&>R%cvQcq)bH~Mms+B#iZ~KVrXul}C{aokwVjv@OgT)$ znR1!(m_{&-WE#aZnrRHvSf+7InC3HCpOWpv$Nc`bZ>lN`uGaK0SF5bwSX?L5)Wwo<;Muji675Fk@jW6yF|Xf-D0x; z+_%p!Jj#M*LCJWN-teDl_CYxVs=36VH-9&^454Y}ZP*E}?Ax%?*&*LmI-gBUXnKPZ z)O5{ia|&~^ULJnAe@>?Ds{(FN!2@3KK?y8?QdkI!U@`b%2`q(WupCyvN+^R>uo~9D zT383=upTO418js%uoEb6_s`)T LWrU<2+*{uP2qO_t