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

https://github.com/flori/json/commit/44df509dc2
2024-03-27 08:24:28 +09:00
..
2024-03-26 12:54:54 +01:00
2023-11-30 08:19:28 +00:00
2024-02-23 10:24:21 -05:00
2024-03-02 16:40:16 +00:00
2024-03-19 09:26:49 +01:00
2024-03-03 00:55:45 +09:00
2023-12-28 18:03:58 +11:00