parsanol 1.3.18-aarch64-linux → 1.3.19-aarch64-linux

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: ec79b496ea0dd5cf94aeb9601343133f685c31782ad573ede40947f4c9ded214
4
- data.tar.gz: 747502b04cf7510313812bde6e4606a741582a2489f2ad745482cf1f47b36a4e
3
+ metadata.gz: 49b68d325094e9538befea2fccb16305ac72f50a1256b324b7749eff6f5b5602
4
+ data.tar.gz: 551a5afa47827939c72848cc572d58b01443c361c4c979964058ce0a3ecc446b
5
5
  SHA512:
6
- metadata.gz: 5bb8a32f322259c12432d610bb1f526db17caf038be37819b089db8e9f9aad991fa2bac63141fe35edacb34841f24a609a0837152dfc1e6427baf53e13a0413c
7
- data.tar.gz: e1feaa6b11461e52844d7d3152ca00a28e9ee939da21575536560bed7049500a70bb664062bc61416c0d86531735f9aac994e8f4fc8d004b4e20876d12263fc7
6
+ metadata.gz: 2f0dc3fc23d8a8b8824246511e2b7acdf8b626b7bb8e49b3be99cf5f0b9eb24a8c7bb6591bc3deea6c1fefb30bf5ed7e360b50d7ca670829a6dbe10516937c83
7
+ data.tar.gz: 7cd18ec11e80851841cb3a556cfa2be92367dab528c0e633cc54ceddf63137771e77d0ce3472db7b3d05437bea60407b35d52e53437be77ffe61664032449dbd
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: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.