json 2.16.0 → 2.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +43 -1
- data/ext/json/ext/fbuffer/fbuffer.h +29 -25
- data/ext/json/ext/generator/extconf.rb +1 -1
- data/ext/json/ext/generator/generator.c +132 -369
- data/ext/json/ext/json.h +13 -0
- data/ext/json/ext/parser/extconf.rb +1 -2
- data/ext/json/ext/parser/parser.c +235 -179
- data/ext/json/ext/simd/simd.h +33 -16
- data/ext/json/ext/vendor/fpconv.c +3 -3
- data/lib/json/common.rb +62 -14
- data/lib/json/ext/generator/state.rb +1 -1
- data/lib/json/truffle_ruby/generator.rb +34 -18
- data/lib/json/version.rb +1 -1
- data/lib/json.rb +33 -0
- metadata +2 -2
data/ext/json/ext/json.h
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
#include "ruby/encoding.h"
|
|
6
6
|
#include <stdint.h>
|
|
7
7
|
|
|
8
|
+
#ifndef RBIMPL_ASSERT_OR_ASSUME
|
|
9
|
+
# define RBIMPL_ASSERT_OR_ASSUME(x)
|
|
10
|
+
#endif
|
|
11
|
+
|
|
8
12
|
#if defined(RUBY_DEBUG) && RUBY_DEBUG
|
|
9
13
|
# define JSON_ASSERT RUBY_ASSERT
|
|
10
14
|
#else
|
|
@@ -45,9 +49,18 @@ typedef unsigned char _Bool;
|
|
|
45
49
|
#endif
|
|
46
50
|
#endif
|
|
47
51
|
|
|
52
|
+
#ifndef HAVE_RB_EXT_RACTOR_SAFE
|
|
53
|
+
# undef RUBY_TYPED_FROZEN_SHAREABLE
|
|
54
|
+
# define RUBY_TYPED_FROZEN_SHAREABLE 0
|
|
55
|
+
#endif
|
|
56
|
+
|
|
48
57
|
#ifndef NORETURN
|
|
58
|
+
#if defined(__has_attribute) && __has_attribute(noreturn)
|
|
59
|
+
#define NORETURN(x) __attribute__((noreturn)) x
|
|
60
|
+
#else
|
|
49
61
|
#define NORETURN(x) x
|
|
50
62
|
#endif
|
|
63
|
+
#endif
|
|
51
64
|
|
|
52
65
|
#ifndef NOINLINE
|
|
53
66
|
#if defined(__has_attribute) && __has_attribute(noinline)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
require 'mkmf'
|
|
3
3
|
|
|
4
|
-
$defs << "-DJSON_DEBUG" if ENV
|
|
4
|
+
$defs << "-DJSON_DEBUG" if ENV.fetch("JSON_DEBUG", "0") != "0"
|
|
5
5
|
have_func("rb_enc_interned_str", "ruby/encoding.h") # RUBY_VERSION >= 3.0
|
|
6
6
|
have_func("rb_str_to_interned_str", "ruby.h") # RUBY_VERSION >= 3.0
|
|
7
7
|
have_func("rb_hash_new_capa", "ruby.h") # RUBY_VERSION >= 3.2
|
|
8
8
|
have_func("rb_hash_bulk_insert", "ruby.h") # Missing on TruffleRuby
|
|
9
|
-
have_func("strnlen", "string.h") # Missing on Solaris 10
|
|
10
9
|
|
|
11
10
|
append_cflags("-std=c99")
|
|
12
11
|
|