parsanol 1.3.18-arm-linux-musl → 1.3.19-arm-linux-musl

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 227419f9fd0bb3e89e6e7de726ee75274f89f5ae08314bc3e2b199e801abf4aa
4
- data.tar.gz: f61c60de9847b1807ddefac7827bd728cd0a8f37093b01a0858ebaadb2f7acc8
3
+ metadata.gz: 3e08a89ca6f9abb3f4647a2038634622f7f8f0404d90304c8fd8319eda91e0cc
4
+ data.tar.gz: 95c8f155f7b26c49b13a9d13d796c8ae01366652a5fcd2a10c8ea1648ebd6e14
5
5
  SHA512:
6
- metadata.gz: 82543d0c357e71183ea3553dcf5274a663463e6f6207f5685be7b3df82a2eac6cbbc74406bf3abfc6cc0669235533f59226044265d22ecaf8ce7005ad6bcf703
7
- data.tar.gz: abf88454df8175d1645214769940deb6d5d863afa9f62b3be526836b17a8a9218a4bee7789c1cc2d94e4b80b6fc3c1dab9af512cec1cc9862cdf6cb234a79121
6
+ metadata.gz: be6f6727f8a86ba2fe2d810b8964ce11f07724ce53aa1a915a591d7ead33b9a89784910033f5681fb5a889b66714bf5acac228e4c48cead8b6650f7596d95245
7
+ data.tar.gz: 2ad49406bcb6855ad6a13bb7e1dda05d8015014949b04c866b9928556fb2601a2f3f5fd5892450511d8f8ac377119c20e3ec913fd3d33b0aba07f4c7ecff3b93
Binary file
Binary file
Binary file
Binary file
@@ -113,13 +113,18 @@ module Parsanol
113
113
  end
114
114
 
115
115
  # Two-call buffer protocol: cap=0 asks for the needed size, then
116
- # one allocation carries the whole batch.
116
+ # the batch lands in a persistent buffer that only grows —
117
+ # steady-state parses allocate nothing.
117
118
  def parse_into(handle, input)
118
119
  needed = @binding.c_parse(handle, input, nil, 0)
119
120
  return needed unless needed.negative?
120
121
 
121
- @buffer = FFI::MemoryPointer.new(:uint64, -needed)
122
- @binding.c_parse(handle, input, @buffer, -needed)
122
+ cap = -needed
123
+ if @buffer.nil? || @buffer.total < cap * 8
124
+ @buffer&.free
125
+ @buffer = FFI::MemoryPointer.new(:uint64, cap * 2)
126
+ end
127
+ @binding.c_parse(handle, input, @buffer, cap)
123
128
  end
124
129
  end
125
130
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.18"
4
+ VERSION = "1.3.19"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsanol
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.18
4
+ version: 1.3.19
5
5
  platform: arm-linux-musl
6
6
  authors:
7
7
  - Ribose Inc.