leptris 1.9.351.0-ppc64le-linux → 1.9.351.1-ppc64le-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: e45b87e127109d3517dd3264aab7f0b3cbd7de894eb575067050df0f2787a46d
4
- data.tar.gz: fc7ebd17537c4fb7d5d15766da666e4617f7c9a1d13b1c353c5691f2e92855e3
3
+ metadata.gz: de247ddca14c60cfd69d9ed3292b78a66b86874d3cf24e0b07a2c758a85c3dfc
4
+ data.tar.gz: cc0c378868c379d168fd14ea4ced6f0c845d8d6e566090c407e21acd4aca8f98
5
5
  SHA512:
6
- metadata.gz: 29a9bff9d47c7715c05f85a0eec1ed7bb7cfb77b79fe291eb2a037dced75c92de41f0df27f39a095093868ca9a3c4ce73f782ef0aa3c7fb6c2e8ef41359bad63
7
- data.tar.gz: 42e741cf955bec6c0976c92d1971a2d1fd79ceeff6ae7ee63641a7b6a2d4b1b89328d1f44a5bc3ee997e780307bcbbd967b0dcec7556f80631f1f9596836096c
6
+ metadata.gz: 728c74ffbb26169a2c708924bdfbe35e17ca4203c4c3640b712ae2e4cb71d7b9c96a31b434da53f435ae533d4c71edb46eca5448f78ee13f3b581a708658f279
7
+ data.tar.gz: e5869ab92030479def6d2d626ab3c7e5b7e57b44d88d0953e6019e295abedfc83a70c9404328c7502b8745c097689db9852c96a70eed446db3cf5e81e5145299
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.351.0"
4
+ VERSION = "1.9.351.1"
5
5
  end
@@ -168,6 +168,58 @@ class Leptris::XML::PlanValue
168
168
  Leptris::XML::FFI.leptris_plan_value_attribute(@ptr, wire_name.to_s)
169
169
  end
170
170
 
171
+ # ELEMENT: ALL bound attributes in one FFI crossing (#1670) —
172
+ # { wire_name => value } in the plan's attribute-row order.
173
+ # Mirrors #children_snapshot: enumerating through #attribute costs
174
+ # one crossing per attribute per node; this costs one per node.
175
+ # Empty hash for non-ELEMENT values.
176
+ def attributes_snapshot
177
+ n = Leptris::XML::FFI.leptris_plan_value_attribute_count(@ptr)
178
+ return {}.freeze if n.zero?
179
+
180
+ @counter[0] += 2 # count + the snapshot crossing
181
+ need = Leptris::XML::FFI.leptris_plan_value_attributes_snapshot(
182
+ @ptr, nil, 0, nil, nil, 0, nil
183
+ )
184
+ return {}.freeze if need.zero?
185
+
186
+ cap = need
187
+ loop do
188
+ names = ::FFI::MemoryPointer.new(:char, cap)
189
+ values = ::FFI::MemoryPointer.new(:char, cap)
190
+ name_offsets = ::FFI::MemoryPointer.new(:size_t, n + 1)
191
+ value_offsets = ::FFI::MemoryPointer.new(:size_t, n + 1)
192
+ rc = Leptris::XML::FFI.leptris_plan_value_attributes_snapshot(
193
+ @ptr, names, cap, name_offsets, values, cap, value_offsets
194
+ )
195
+ break attributes_snapshot_build(
196
+ names, name_offsets, values, value_offsets, n
197
+ ) if rc.zero?
198
+
199
+ # The sizing call reports the exact capacity, so (size_t)-1
200
+ # here can only mean the tree grew between calls — retry at
201
+ # the doubled guess rather than looping on a stale size.
202
+ raise "attributes snapshot failed" if rc != SIZE_MAX
203
+
204
+ cap *= 2
205
+ end
206
+ end
207
+
208
+ def attributes_snapshot_build(names, name_offsets, values,
209
+ value_offsets, n)
210
+ result = {}
211
+ n.times do |i|
212
+ noff = name_offsets.get_uint64(i * SIZE_T_SIZE)
213
+ voff = value_offsets.get_uint64(i * SIZE_T_SIZE)
214
+ # Raw pointer reads come back ASCII-8BIT; the per-name reader
215
+ # attaches UTF8_STRING, so match its encoding contract.
216
+ result[names.get_string(noff).force_encoding(Encoding::UTF_8)] =
217
+ values.get_string(voff).force_encoding(Encoding::UTF_8)
218
+ end
219
+ result
220
+ end
221
+ private :attributes_snapshot_build
222
+
171
223
  # The number of FFI accessor calls this PlanValue (and its
172
224
  # #as_kwarg_hash descendants, via the borrowed-#at chain) have
173
225
  # counted. Reset with #reset_crossings! before the work you want
@@ -245,9 +297,11 @@ class Leptris::XML::PlanValue
245
297
  private
246
298
 
247
299
  def kwarg_attributes
248
- ((@plan && @plan[:attributes]) || []).each_with_object({}) do |row, result|
249
- v = attribute(row[:name])
250
- result[row[:name]] = cast_attribute(v, row) unless v.nil?
300
+ rows = ((@plan && @plan[:attributes]) || [])
301
+ by_name = rows.each_with_object({}) { |row, h| h[row[:name]] = row }
302
+ attributes_snapshot.each_with_object({}) do |(k, v), result|
303
+ row = by_name[k]
304
+ result[k] = row ? cast_attribute(v, row) : v
251
305
  end
252
306
  end
253
307
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.351.0
4
+ version: 1.9.351.1
5
5
  platform: ppc64le-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-13 00:00:00.000000000 Z
11
+ date: 2026-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi