leptris 1.9.248.0 → 1.9.249.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d4945b25ab8d7db217c541ca9a1ae2db6e7cfa3aea67584b7a7520ec0fcbf6e5
|
|
4
|
+
data.tar.gz: b6a0355bceb4087bca19781de7ca02d1ad5fc35725685fba92e68591c0e5922a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abc9546e36bf7f05cbb384fd84afd2ecbf9442d11f4ad7d9d5f705230096797b24bbf20e4f8542ecaf28746427db98cc1551159701cec6f18b437f751e6592a7
|
|
7
|
+
data.tar.gz: 13479600b858874e7f4f499eafb70cda0a97ec46f0248b0897e4878ca5a9e8ee84ca5a826cf5e4cccc7e2a27c95b554d6ce33e59a07270225f5a6c13ce5389a0
|
|
Binary file
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/cdata.rb
CHANGED
|
@@ -4,6 +4,13 @@ class Leptris::XML::CDATA < Leptris::XML::Text
|
|
|
4
4
|
def name; "#cdata-section"; end
|
|
5
5
|
|
|
6
6
|
def content
|
|
7
|
+
# Frozen-tree fast path (leptris-ruby#336): frozen leaves are
|
|
8
|
+
# COW — never written in place — so a populated memo is eternal;
|
|
9
|
+
# skips the memo_hit?/ensure_alive!/version dispatch chain.
|
|
10
|
+
# Elements must NOT take this path: a frozen parent's child slot
|
|
11
|
+
# is re-pointed on child COW, so subtree content can change.
|
|
12
|
+
return @content if @content && @document && @document.frozen_tree?
|
|
13
|
+
|
|
7
14
|
return @content if memo_hit?(@content_version)
|
|
8
15
|
ensure_alive!
|
|
9
16
|
result = if @addr_reads_fast
|
data/lib/leptris/xml/comment.rb
CHANGED
|
@@ -4,6 +4,13 @@ class Leptris::XML::Comment < Leptris::XML::Node
|
|
|
4
4
|
def name; "comment"; end
|
|
5
5
|
|
|
6
6
|
def content
|
|
7
|
+
# Frozen-tree fast path (leptris-ruby#336): frozen leaves are
|
|
8
|
+
# COW — never written in place — so a populated memo is eternal;
|
|
9
|
+
# skips the memo_hit?/ensure_alive!/version dispatch chain.
|
|
10
|
+
# Elements must NOT take this path: a frozen parent's child slot
|
|
11
|
+
# is re-pointed on child COW, so subtree content can change.
|
|
12
|
+
return @content if @content && @document && @document.frozen_tree?
|
|
13
|
+
|
|
7
14
|
return @content if memo_hit?(@content_version)
|
|
8
15
|
ensure_alive!
|
|
9
16
|
result = if @addr_reads_fast
|
data/lib/leptris/xml/document.rb
CHANGED
|
@@ -29,6 +29,17 @@ class Leptris::XML::Document
|
|
|
29
29
|
@version += 1
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
# True when the underlying tree is frozen — parse-created trees
|
|
33
|
+
# are carved frozen, and leptris_document_freeze freezes in place.
|
|
34
|
+
# Frozen nodes are never WRITTEN: mutations copy-on-write, so a
|
|
35
|
+
# leaf-content memo taken under a frozen tree is eternally valid
|
|
36
|
+
# (leptris-ruby#336). Memoized — freeze has no inverse; caching
|
|
37
|
+
# false just keeps the version-checked path (still correct).
|
|
38
|
+
def frozen_tree?
|
|
39
|
+
@frozen_tree = Leptris::XML::FFI.leptris_document_is_frozen(c_ptr) == 1 if @frozen_tree.nil?
|
|
40
|
+
@frozen_tree
|
|
41
|
+
end
|
|
42
|
+
|
|
32
43
|
def initialize(c_ptr = nil, freed = Freed.new(:alive))
|
|
33
44
|
@c_ptr = c_ptr
|
|
34
45
|
# Plain-Integer address twin of c_ptr: the native layer reads
|
data/lib/leptris/xml/text.rb
CHANGED
|
@@ -4,6 +4,13 @@ class Leptris::XML::Text < Leptris::XML::Node
|
|
|
4
4
|
def name; "text"; end
|
|
5
5
|
|
|
6
6
|
def content
|
|
7
|
+
# Frozen-tree fast path (leptris-ruby#336): frozen leaves are
|
|
8
|
+
# COW — never written in place — so a populated memo is eternal;
|
|
9
|
+
# skips the memo_hit?/ensure_alive!/version dispatch chain.
|
|
10
|
+
# Elements must NOT take this path: a frozen parent's child slot
|
|
11
|
+
# is re-pointed on child COW, so subtree content can change.
|
|
12
|
+
return @content if @content && @document && @document.frozen_tree?
|
|
13
|
+
|
|
7
14
|
return @content if memo_hit?(@content_version)
|
|
8
15
|
ensure_alive!
|
|
9
16
|
result = if @addr_reads_fast
|