parsanol 1.3.18 → 1.3.19

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: 8c155ba9401ec5127188455f4411e52798b18b4647a7e0032aac8704f6390a4e
4
- data.tar.gz: 6944ad7cafb74447a8822b88d6bbc6c2da5bce111da7dcbd3e75bb3facf09b14
3
+ metadata.gz: 10bccd4c5f416785cb8b99fc62af21c252224615fd0b660e2419a2dc2e097dcd
4
+ data.tar.gz: 47fb2ddd5266b94fce6d5eb933487980bd24dbf340845955b11c887c9fa6a425
5
5
  SHA512:
6
- metadata.gz: 6b53a9d7cad648052f790dbd3577968e085652ae91dda58f095175e815c349182d9387fd897f141d2d41225226ad417594e6bdd18d0c352b574ca008759bf73a
7
- data.tar.gz: 857eb89870d64a905b540237d694f0f991eb2e7665489a8bfc5f5225444a95fddb309b9749829869293f863a479c3dcf698a904596ecbda716b50d251c85bd54
6
+ metadata.gz: 0a698266eb88df5f1c1fb584f67cf390ab241039767579746388b40850e92ab4edfa7fed5ef3ea198c3ecd00c32fc2e52a0f942f454702e1ba2a30ea0514f420
7
+ data.tar.gz: d0b8ef5dff908def4a5a3560dba1e4cf9eec3f7c5d3bdbd93fd9ae14c48078e3f16a3facf4c537d83edc679e1f6885fb9646c770f8360af15cf80cd2db0c34a3
data/Cargo.lock CHANGED
@@ -253,7 +253,7 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
253
253
  [[package]]
254
254
  name = "parsanol"
255
255
  version = "0.5.1"
256
- source = "git+https://github.com/parsanol/parsanol-rs?branch=main#7357b1a1885355a7116cd9c4c58a2c9d2d559bee"
256
+ source = "git+https://github.com/parsanol/parsanol-rs?branch=main#8f18078917477822c771f191fdd27ec81888b970"
257
257
  dependencies = [
258
258
  "ahash",
259
259
  "getrandom 0.3.4",
@@ -270,7 +270,7 @@ dependencies = [
270
270
  [[package]]
271
271
  name = "parsanol-derive"
272
272
  version = "0.5.1"
273
- source = "git+https://github.com/parsanol/parsanol-rs?branch=main#7357b1a1885355a7116cd9c4c58a2c9d2d559bee"
273
+ source = "git+https://github.com/parsanol/parsanol-rs?branch=main#8f18078917477822c771f191fdd27ec81888b970"
274
274
  dependencies = [
275
275
  "proc-macro2",
276
276
  "quote",
@@ -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: ruby
6
6
  authors:
7
7
  - Ribose Inc.