parsanol 1.3.18-aarch64-linux → 1.3.20-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: c7de039add41f3a63a8f64c0a3007e4d6e6a270ecc89e8f4a8b5ceca5cde6da9
4
+ data.tar.gz: f45a3b33a7f49b3a55a3d25d718885960e0590ef6fe43b458c3cbc872d6963bf
5
5
  SHA512:
6
- metadata.gz: 5bb8a32f322259c12432d610bb1f526db17caf038be37819b089db8e9f9aad991fa2bac63141fe35edacb34841f24a609a0837152dfc1e6427baf53e13a0413c
7
- data.tar.gz: e1feaa6b11461e52844d7d3152ca00a28e9ee939da21575536560bed7049500a70bb664062bc61416c0d86531735f9aac994e8f4fc8d004b4e20876d12263fc7
6
+ metadata.gz: 2b36fd49b2e579e526d17bbdf52552843b84854b4fa62e7a1ba7a13fb6a0435fc64514dc75105e991fbfca498c604f8a1c55572339fc4ebe9791a365844b93bc
7
+ data.tar.gz: e5f5f5e32c7513a4cd1ee22cdc8b6e774f4df3abcf5b3386950d6770e39b4b3e65e1515977ab2e4cd36103648a3fe3de3ec2094b596993381c4f907b2976ee63
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: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.