leptris 1.9.5 → 1.9.6
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/CHANGELOG.md +15 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/node.rb +7 -2
- 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: 68bba6b5b68f0266571ec17a5809ea42ce7b1f37f0ba3577f9a06afd57db578f
|
|
4
|
+
data.tar.gz: d15442dd463ba2b4d09c6415e51c478c385c851eb6630ffc8c4d00e6a9ad7a57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52a5f4a5307b9b219911a9ebb7050672be1ad27096266e1c0732eb98ab40779055dcf25e4dd31c0ef0813966539e43894c6d4cdce20bd79e778a7df043c5631a
|
|
7
|
+
data.tar.gz: cd2e0732f88060f6ff02e3496bedca3d986fde26c9400c91efe458c05e96379caeddd50a5950eb65b965be23487aac243ada697855ade71d0ed6017bcfe49433
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to Leptris will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.6] - 2026-08-26
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- The lifetime guard (`ensure_alive!`) uses the cheapest sufficient
|
|
13
|
+
check (`Document#c_ptr.nil?` — `#free` nils it, and the GC
|
|
14
|
+
finalizer cannot fire while any handle exists) instead of the
|
|
15
|
+
deeper `Document#freed?` chain. Claw back on the cheapest single-
|
|
16
|
+
dispatch read (`Element#[]` hot loops): ~20% of the guard's cost.
|
|
17
|
+
Remaining guard cost is the method dispatch itself — the price of
|
|
18
|
+
the lifetime contract on the one call shape cheap enough to
|
|
19
|
+
notice it; all other harness loops measure at parity, and
|
|
20
|
+
readonly hot loops have the memoized `attributes`/`keys`
|
|
21
|
+
alternatives.
|
|
22
|
+
|
|
8
23
|
## [1.9.5] - 2026-08-26
|
|
9
24
|
|
|
10
25
|
### Fixed
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/node.rb
CHANGED
|
@@ -87,9 +87,14 @@ class Leptris::XML::Node
|
|
|
87
87
|
|
|
88
88
|
# Borrowed-handle lifetime: every c_ptr dereference is valid only
|
|
89
89
|
# while the owning document lives. Parentless nodes (iterparse
|
|
90
|
-
# yields) cannot validate and are skipped.
|
|
90
|
+
# yields) cannot validate and are skipped. The guard runs before
|
|
91
|
+
# every uncached FFI dispatch, so it uses the cheapest sufficient
|
|
92
|
+
# check: #free nils the document's c_ptr, and the GC-finalizer
|
|
93
|
+
# path cannot fire while any handle (which strongly references
|
|
94
|
+
# the document) exists. Document#freed? remains the accurate
|
|
95
|
+
# public predicate.
|
|
91
96
|
def ensure_alive!
|
|
92
|
-
if @document
|
|
97
|
+
if @document && @document.c_ptr.nil?
|
|
93
98
|
raise Leptris::XML::UseAfterFreeError,
|
|
94
99
|
"owning document has been freed — handle used on #{inspect}"
|
|
95
100
|
end
|