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 +4 -4
- data/Cargo.lock +2 -2
- data/lib/parsanol/native/ffi.rb +8 -3
- data/lib/parsanol/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 10bccd4c5f416785cb8b99fc62af21c252224615fd0b660e2419a2dc2e097dcd
|
|
4
|
+
data.tar.gz: 47fb2ddd5266b94fce6d5eb933487980bd24dbf340845955b11c887c9fa6a425
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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#
|
|
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#
|
|
273
|
+
source = "git+https://github.com/parsanol/parsanol-rs?branch=main#8f18078917477822c771f191fdd27ec81888b970"
|
|
274
274
|
dependencies = [
|
|
275
275
|
"proc-macro2",
|
|
276
276
|
"quote",
|
data/lib/parsanol/native/ffi.rb
CHANGED
|
@@ -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
|
-
#
|
|
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
|
-
|
|
122
|
-
@
|
|
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
|
data/lib/parsanol/version.rb
CHANGED