leptris 1.9.366.1-aarch64-linux → 1.9.366.2-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 +4 -4
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/descriptor.rb +25 -6
- 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: d2beb0d74159e7544c95208f0c8dc275285f81eea018ff8b919fccca7cf07676
|
|
4
|
+
data.tar.gz: 495665533e501bc90cb1ebe0327f40c3de43e6f40b0c33c0093e978e8d300eb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd7f95412d8c80bfe1423b5fe29948c8dfd9991f7294eb14ebc5dc3bcdae08919ff02be836ab0345d0543e36b0c4a7d00c949654b073f70c373eda643c69fee2
|
|
7
|
+
data.tar.gz: fab1e86554a44009b390ede1de80865b5fd945f159fd864d3dcbe901501d9087bb3dc67ee5e5c51e10989bc5c7b56e745c5d04e0958512013b0348448e1ca201
|
data/lib/leptris/version.rb
CHANGED
|
@@ -126,7 +126,7 @@ class Leptris::XML::Descriptor
|
|
|
126
126
|
"descriptor ABI v#{abi} != binding v#{Leptris::XML::FFI::PLAN_ABI_VERSION}"
|
|
127
127
|
end
|
|
128
128
|
plans = []
|
|
129
|
-
root_index = flatten_plan(tree, plans)
|
|
129
|
+
root_index = flatten_plan(tree, plans, {})
|
|
130
130
|
spec, plans_pointer, anchors = pack_plans(plans)
|
|
131
131
|
spec[:abi_version] = abi
|
|
132
132
|
spec[:plan_count] = plans.size
|
|
@@ -143,13 +143,32 @@ class Leptris::XML::Descriptor
|
|
|
143
143
|
# Flattens the nested hash tree into the engine's flat plans
|
|
144
144
|
# array (child rows reference plans by index). Returns the root
|
|
145
145
|
# plan's index — always 0 for a single root.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
#
|
|
147
|
+
# Identity-memoized (leptris#1743): lutaml-model's PlanCompiler
|
|
148
|
+
# (0.8.107+) feeds recursive content models as a DAG — the SAME
|
|
149
|
+
# plan Hash reachable from many parents. Without the memo each
|
|
150
|
+
# shared subtree re-flattened once per path (2^depth visits: the
|
|
151
|
+
# STS runaway — 28+ CPU-min, 14 GB RSS) and the duplicated index
|
|
152
|
+
# graph even mis-walked. Memoize on the ARGUMENT's identity
|
|
153
|
+
# (object_id, read before the dup) so each unique plan object is
|
|
154
|
+
# flattened once and shared rows reference one index.
|
|
155
|
+
def self.flatten_plan(tree, plans, memo = {})
|
|
156
|
+
key = tree.object_id
|
|
157
|
+
hit = memo[key]
|
|
158
|
+
return hit if hit
|
|
159
|
+
|
|
160
|
+
raise Leptris::XML::Error,
|
|
161
|
+
"plan tree contains a cycle at #{tree[:name].inspect} — " "the plan graph must be a DAG" if hit == false
|
|
162
|
+
|
|
163
|
+
memo[key] = false # in-progress; a finished entry is an Integer index
|
|
164
|
+
duped = tree.dup
|
|
165
|
+
plans << duped
|
|
149
166
|
tree_index = plans.size - 1
|
|
150
|
-
|
|
167
|
+
memo[key] = tree_index
|
|
168
|
+
duped[:children] = (duped[:children] || []).map do |row|
|
|
151
169
|
if row[:kind] == :nested
|
|
152
|
-
row.merge(child_plan_index: flatten_plan(row.fetch(:plan), plans
|
|
170
|
+
row.merge(child_plan_index: flatten_plan(row.fetch(:plan), plans,
|
|
171
|
+
memo))
|
|
153
172
|
else
|
|
154
173
|
row
|
|
155
174
|
end
|