ruby/ext/json/generator
Peter Zhu 6e34386794
[flori/json] Fix memory leak when exception is raised during JSON generation
If an exception is raised the FBuffer is leaked.

For example, the following script leaks memory:

    o = Object.new
    def o.to_json(a) = raise

    10.times do
      100_000.times do
        begin
          JSON(o)
        rescue
        end
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    31824
    35696
    40240
    44304
    47424
    50944
    54000
    58384
    62416
    65296

After:

    24416
    24640
    24640
    24736
    24736
    24736
    24736
    24736
    24736
    24736

44df509dc2
2024-03-27 08:24:28 +09:00
..
depend Update the depend files 2023-02-28 09:09:00 -08:00
extconf.rb
generator.c [flori/json] Fix memory leak when exception is raised during JSON generation 2024-03-27 08:24:28 +09:00
generator.h Manually merged from flori/json 2023-12-01 16:47:06 +09:00