yeptris 0.6.47.0-aarch64-linux → 0.6.48.0-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: 653e8a27e48a658a1232063a9031730f764203d2ff7b15a24158882d4536c1db
4
- data.tar.gz: 90bc2c8ee8e376f1ec2373365fa6f18c27c188e0c60244cd10c05c8206d13536
3
+ metadata.gz: 35fb61a844f3c216af5b507b1734b3b35ec903925bcbb17a8d2ea650fa501eaf
4
+ data.tar.gz: 4120fa28eef23c4d25e474030efd19c21a88d663a4db944d2e12f762673b475e
5
5
  SHA512:
6
- metadata.gz: d6c0ed641dfe83cd513d5c17b8f65a0cb83dc6152f61f46e4ffd4c43f60d15340d8bbbb47a58e43ce9c06bb3f03e9d01c28e12f27e49a52a865fae02927778a9
7
- data.tar.gz: e4f90f9bfb449b0bd8493e4cb01190e236fef512d854d23004654f269498f7e01b057d2106cf9441cc6f053c1966da4c3d0120a70dabdf43169d80ccf8c0c658
6
+ metadata.gz: 651d7bd9d2b054ebe3af1d2047f304e9a6aeb7e8f3c6dd0a04efb93143f2634b3ae6764d6392a783538589b45e9d6a9f4a7c979647005e565a0c3529ffc7ec7e
7
+ data.tar.gz: 2ea6d6b6c9c51c9cfcac877a097f4c86affd0d1af7b51b489891f1766b62880d0011c8c7054d00850315e88c919934c66faebf57dc301d9382ce806ec43ae6ef
@@ -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 47
15
- #define YEPTRIS_VERSION_STRING "0.6.47"
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.47.0".freeze
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
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(yeptris
6
- VERSION 0.6.47
6
+ VERSION 0.6.48
7
7
  DESCRIPTION "Ultra-fast YAML 1.2 parser, emitter and streamer in C"
8
8
  LANGUAGES C CXX
9
9
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yeptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.47.0
4
+ version: 0.6.48.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.