parsanol 1.3.18-arm-linux → 1.3.20-arm-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: 45f994eb76e90770b0525fe5a6e4cca6f79e991d47aa0f97a57cbbc98bdfe2e9
4
- data.tar.gz: 479fc66ba4c43d441a9fd6f6ab861d646400c348ae13c7ce1d32573f16e1811a
3
+ metadata.gz: 6d76cc74fa83f24892a20151f4d00e26796369a7cf91c8eb0be9953c9ed88d97
4
+ data.tar.gz: 95b886fa294868655c11ac2f0f4af478938cd652443e4223984e353a32e9a195
5
5
  SHA512:
6
- metadata.gz: bd507859a99a34c4296c1eda4fe10ff58605e69b35b8e6753089574c9038c49b99ad802eafe24eaf50f443f64bf55a81227e535d56d4592efb2d3928763bdab9
7
- data.tar.gz: 3c1b5a60291d62b0f855ba2ff6c61a4824220056ed906d5063f8162aad48e9eee2a352fdaf9bb29cb96f6087c682392ac1ddfd1e09d9d156d187cac423b72d36
6
+ metadata.gz: 832f18e35bcbb87a6580e9336c5f24ca5c72d4af5909312972588c4883a75c1cfe2bfecb1826afb0d0a7276e718b2c57a0664994e008785f89ad5346493fd65d
7
+ data.tar.gz: bfca5015be35fed03a5b30bf68d78ce6bbf006ae513a568a560f24cc09825346bd96d9479377eac1f5cde2f57923c74fe4d0f09ca07411732627fb9ef08c4925
Binary file
Binary file
Binary file
Binary file
@@ -51,6 +51,7 @@ module Parsanol
51
51
  # Register with Rust FFI
52
52
  ffi_id = Native.register_callback(@next_id,
53
53
  description || "Ruby callback ##{@next_id}")
54
+ @next_id += 1
54
55
 
55
56
  # Also keep a Ruby-side reference for GC safety
56
57
  @mutex.synchronize do
@@ -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
@@ -12,6 +12,9 @@ module Parsanol
12
12
  module Native
13
13
  # ffi-gem cdylib tier: lazy — only loaded when the MRI extension is absent.
14
14
  autoload :Ffi, "parsanol/native/ffi"
15
+ # Dynamic-atom callbacks: autoloaded so the serializer's reference
16
+ # never raises NameError into the silent :ruby fallback (issue #38).
17
+ autoload :Dynamic, "parsanol/native/dynamic"
15
18
  class << self
16
19
  # Check if native extension is available
17
20
  def available?
@@ -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.20"
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.20
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Ribose Inc.