yeptris 0.6.47.0-powerpc64le-linux → 0.6.48.0-powerpc64le-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 +4 -4
- data/ext/yeptris_native/version.h +2 -2
- data/lib/yeptris/ffi.rb +8 -0
- data/lib/yeptris/json.rb +34 -0
- data/lib/yeptris.rb +1 -1
- data/libyeptris.so +0 -0
- data/vendor/libyeptris/CMakeLists.txt +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: a01ac48e4985cd64c43c5fae3211c7ca5be01f8058dadc2fe54e79e35114d19e
|
|
4
|
+
data.tar.gz: 174ba0453fbd2a70ca2677c4bacf27a80db0f432517fb47e987851068687858a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f15722d50ce151dd97eb3a4c4c48493513be32f32199b9e2e175719408d80e282f5fa7816a9c93fc6d65ab96ffb4bea39a3bd60cbe0b594eb043f86a12a54f0
|
|
7
|
+
data.tar.gz: c7a90d442b1a67a711794f4e7278285387dfdc30fc2215294284339efe790607b29273e0d58d01601a669eded1b27237ea6e15f361ceb2aed72d609a839abdd0
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
#define YEPTRIS_VERSION_MAJOR 0
|
|
13
13
|
#define YEPTRIS_VERSION_MINOR 6
|
|
14
|
-
#define YEPTRIS_VERSION_PATCH
|
|
15
|
-
#define YEPTRIS_VERSION_STRING "0.6.
|
|
14
|
+
#define YEPTRIS_VERSION_PATCH 48
|
|
15
|
+
#define YEPTRIS_VERSION_STRING "0.6.48"
|
|
16
16
|
|
|
17
17
|
#ifdef __cplusplus
|
|
18
18
|
extern "C" {
|
data/lib/yeptris/ffi.rb
CHANGED
|
@@ -232,6 +232,11 @@ module Yeptris
|
|
|
232
232
|
attach_function :yeptris_marshal_node_ex,
|
|
233
233
|
%i[yeptris_node uint32 pointer pointer], :int
|
|
234
234
|
attach_function :yeptris_marshal_free, [:pointer], :void
|
|
235
|
+
# yeptris-ruby#322: the dump face (engine 0.6.45+; the attachment
|
|
236
|
+
# helper records the miss into @missing on older libraries —
|
|
237
|
+
# MARSHAL_JSON goes false and the dump keeps the per-node walk)
|
|
238
|
+
attach_function :yeptris_json_from_marshal,
|
|
239
|
+
%i[pointer size_t int pointer pointer], :int
|
|
235
240
|
# The bulk child drain (#168's quadratic): O(n) iteration for
|
|
236
241
|
# #each/#each_pair. Engines without it fall back to the per-index
|
|
237
242
|
# walk (correct, quadratic).
|
|
@@ -240,6 +245,9 @@ module Yeptris
|
|
|
240
245
|
# the strict-dup marshal entry (engine 0.6.34+, yeptris-ruby#278):
|
|
241
246
|
# gates the JSON fallback's C route in STRICT mode
|
|
242
247
|
MARSHAL_STRICT_DUP = !(@missing ||= []).include?(:yeptris_marshal_node_ex)
|
|
248
|
+
# the dump face (yeptris-ruby#322, engine 0.6.45+): Ruby
|
|
249
|
+
# Marshal.dump bytes -> JSON text in one C call
|
|
250
|
+
MARSHAL_JSON = !(@missing ||= []).include?(:yeptris_json_from_marshal)
|
|
243
251
|
# engine flag value (yeptris.h: YEPTRIS_MARSHAL_STRICT_DUP_KEYS 1u);
|
|
244
252
|
# defined whether or not the entry exists, because the JSON fallback
|
|
245
253
|
# references it on lanes without a Ruby-version-matched native ext
|
data/lib/yeptris/json.rb
CHANGED
|
@@ -368,6 +368,16 @@ module Yeptris
|
|
|
368
368
|
class DumpError < Error; end
|
|
369
369
|
|
|
370
370
|
def dump(obj, pretty: false, indent: " ")
|
|
371
|
+
# yeptris-ruby#322: the marshal route — Marshal.dump walks the
|
|
372
|
+
# host tree IN C (3.3 ms vs place_obj's 12.3 ms on the 200 KB
|
|
373
|
+
# corpus) and the engine's marshal reader emits JSON from those
|
|
374
|
+
# bytes in one call. The per-node place_obj walk remains for
|
|
375
|
+
# pretty (the reader emits compact/spaced only), for engines
|
|
376
|
+
# without the face, and for marshal-undumpable hosts.
|
|
377
|
+
unless pretty
|
|
378
|
+
r = marshal_json_dump(obj)
|
|
379
|
+
return r unless r.nil?
|
|
380
|
+
end
|
|
371
381
|
parts = String.new(encoding: Encoding::BINARY,
|
|
372
382
|
capacity: 12 * 16) # 12-byte entries, appended in place
|
|
373
383
|
blob = String.new(encoding: Encoding::BINARY)
|
|
@@ -394,6 +404,30 @@ module Yeptris
|
|
|
394
404
|
doc&.free
|
|
395
405
|
end
|
|
396
406
|
|
|
407
|
+
# yeptris-ruby#322: Marshal.dump bytes -> JSON text in ONE C call
|
|
408
|
+
# (yeptris_json_from_marshal, engine 0.6.45+). Returns nil when
|
|
409
|
+
# the route is unavailable (no face, or the engine answered
|
|
410
|
+
# UNSUPPORTED — objects, structs, wide bignums) and the caller
|
|
411
|
+
# falls back to the per-node walk. Marshal-undumpable hosts raise
|
|
412
|
+
# TypeError, which the caller's own contract surfaces anyway.
|
|
413
|
+
def marshal_json_dump(obj)
|
|
414
|
+
return nil unless defined?(::Yeptris::FFI::MARSHAL_JSON) &&
|
|
415
|
+
::Yeptris::FFI::MARSHAL_JSON
|
|
416
|
+
m = Marshal.dump(obj)
|
|
417
|
+
out_p = ::FFI::MemoryPointer.new(:pointer)
|
|
418
|
+
olen_p = ::FFI::MemoryPointer.new(:size_t)
|
|
419
|
+
st = ::Yeptris::FFI.yeptris_json_from_marshal(
|
|
420
|
+
m, m.bytesize, 1, out_p, olen_p
|
|
421
|
+
)
|
|
422
|
+
return nil if st == ::Yeptris::FFI::ERROR_UNSUPPORTED
|
|
423
|
+
raise ParseError, ::Yeptris::FFI.last_error_message unless st == ::Yeptris::FFI::OK
|
|
424
|
+
buf = out_p.read_pointer
|
|
425
|
+
data = buf.read_bytes(::Yeptris::FFI.read_c_size_t(olen_p))
|
|
426
|
+
::Yeptris::FFI.yeptris_marshal_free(buf)
|
|
427
|
+
data.force_encoding(Encoding::UTF_8)
|
|
428
|
+
data
|
|
429
|
+
end
|
|
430
|
+
|
|
397
431
|
F = ::Yeptris::FFI
|
|
398
432
|
MAP_E = [F::BUILD_MAP, 0, 0, 0].pack("CCx2VV").freeze
|
|
399
433
|
SEQ_E = [F::BUILD_SEQ, 0, 0, 0].pack("CCx2VV").freeze
|
data/lib/yeptris.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Yeptris
|
|
4
4
|
# The gem's version lives in the parent namespace's file — the last
|
|
5
5
|
# internal require (yeptris/version) retired with it.
|
|
6
|
-
VERSION = "0.6.
|
|
6
|
+
VERSION = "0.6.48.0".freeze
|
|
7
7
|
|
|
8
8
|
# Informational notices are OPT-IN (yeptris-ruby#217): consumers
|
|
9
9
|
# embed yeptris inside CLIs that assert clean stderr, and a
|
data/libyeptris.so
CHANGED
|
Binary file
|