diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-02-06 10:03:12 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-02-06 09:23:16 +0000 |
| commit | 6e18331074f188ef79241e3f5155f225da4bd440 (patch) | |
| tree | 8b1d9b19250efcc4449f5b0111109e76e1f01145 /test | |
| parent | 17caec3cab53f16ab4e338858560519082e5dd48 (diff) | |
[ruby/json] Stop using RB_ALLOCV
While it's a very nice API, if the buffer is too big for the
stack (> 1024B) the buffer object will be mark like a stack region
which is slow and overkill for a char buffer.
https://github.com/ruby/json/commit/4dcbcb84a2
Diffstat (limited to 'test')
| -rw-r--r-- | test/json/json_parser_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb index ac53ba9f0c..1b875422a1 100644 --- a/test/json/json_parser_test.rb +++ b/test/json/json_parser_test.rb @@ -135,6 +135,10 @@ class JSONParserTest < Test::Unit::TestCase bignum = Integer('1234567890' * 10) assert_equal(bignum, JSON.parse(bignum.to_s)) assert_equal(bignum.to_f, JSON.parse(bignum.to_s + ".0")) + + bignum = Integer('1234567890' * 50) + assert_equal(bignum, JSON.parse(bignum.to_s)) + assert_equal(bignum.to_f, JSON.parse(bignum.to_s + ".0")) end def test_parse_bigdecimals |
