json 2.7.6 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +15 -0
- data/README.md +8 -77
- data/ext/json/ext/fbuffer/fbuffer.h +85 -51
- data/ext/json/ext/generator/generator.c +327 -204
- data/ext/json/ext/parser/extconf.rb +5 -27
- data/ext/json/ext/parser/parser.c +1536 -474
- data/ext/json/ext/parser/parser.rl +717 -243
- data/json.gemspec +4 -1
- data/lib/json/add/bigdecimal.rb +1 -1
- data/lib/json/common.rb +200 -59
- data/lib/json/ext/generator/state.rb +1 -31
- data/lib/json/ext.rb +2 -4
- data/lib/json/{pure → truffle_ruby}/generator.rb +150 -128
- data/lib/json/version.rb +1 -1
- data/lib/json.rb +15 -20
- metadata +4 -8
- data/ext/json/ext/generator/generator.h +0 -118
- data/ext/json/ext/parser/parser.h +0 -60
- data/lib/json/pure/parser.rb +0 -331
- data/lib/json/pure.rb +0 -16
@@ -1,33 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'mkmf'
|
3
3
|
|
4
|
-
have_func("
|
5
|
-
have_func("
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
a = -(%w(t e s t).join)
|
10
|
-
b = -(%w(t e s t).join)
|
11
|
-
if a.equal?(b)
|
12
|
-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE=1 '
|
13
|
-
else
|
14
|
-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE=0 '
|
15
|
-
end
|
16
|
-
rescue NoMethodError
|
17
|
-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE=0 '
|
18
|
-
end
|
19
|
-
|
20
|
-
# checking if String#-@ (str_uminus) directly interns frozen strings... '
|
21
|
-
begin
|
22
|
-
s = rand.to_s.freeze
|
23
|
-
if (-s).equal?(s) && (-s.dup).equal?(s)
|
24
|
-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=1 '
|
25
|
-
else
|
26
|
-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
|
27
|
-
end
|
28
|
-
rescue NoMethodError
|
29
|
-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
|
30
|
-
end
|
4
|
+
have_func("rb_enc_interned_str", "ruby.h") # RUBY_VERSION >= 3.0
|
5
|
+
have_func("rb_hash_new_capa", "ruby.h") # RUBY_VERSION >= 3.2
|
6
|
+
have_func("rb_gc_mark_locations", "ruby.h") # Missing on TruffleRuby
|
7
|
+
have_func("rb_hash_bulk_insert", "ruby.h") # Missing on TruffleRuby
|
8
|
+
have_func("rb_category_warn", "ruby.h") # Missing on TruffleRuby
|
31
9
|
|
32
10
|
append_cflags("-std=c99")
|
33
11
|
|