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: 1445126f3a7bced66c8ccb08c13e6d61f0a8ffc95f154bb091aedd07e54ef706
4
- data.tar.gz: c0c39cf6600337d568dfae5237f650a5b3aa1ebab16b42a648fff456c9d8f050
3
+ metadata.gz: d4945b25ab8d7db217c541ca9a1ae2db6e7cfa3aea67584b7a7520ec0fcbf6e5
4
+ data.tar.gz: b6a0355bceb4087bca19781de7ca02d1ad5fc35725685fba92e68591c0e5922a
5
5
  SHA512:
6
- metadata.gz: 35a1e9c1637cdfb8d2556d6ce9e10b5fce62b369f5824ae4b9a941026dee156bc54aa5d8dc9d30ba2fe25e8403d096c45449234ed29b422ce5d12febeca9d7ec
7
- data.tar.gz: 36a555006ae5e9bb900eaa2f4955c337e4251dbfdd58be20ba91b4825b79de86a6fd8a8b161608c4f71c3d49422d68f3c97e6720e0baceac47e6de7cd0a8e26d
6
+ metadata.gz: abc9546e36bf7f05cbb384fd84afd2ecbf9442d11f4ad7d9d5f705230096797b24bbf20e4f8542ecaf28746427db98cc1551159701cec6f18b437f751e6592a7
7
+ data.tar.gz: 13479600b858874e7f4f499eafb70cda0a97ec46f0248b0897e4878ca5a9e8ee84ca5a826cf5e4cccc7e2a27c95b554d6ce33e59a07270225f5a6c13ce5389a0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.248.0"
4
+ VERSION = "1.9.249.0"
5
5
  end
@@ -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
@@ -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
@@ -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
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.248.0
4
+ version: 1.9.249.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.