leptris 1.9.456.0 → 1.9.458.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/lib/leptris/vendor/aarch64-linux/libleptris.so +0 -0
  4. data/lib/leptris/vendor/aarch64-linux-musl/libleptris.so +0 -0
  5. data/lib/leptris/vendor/arm-linux/libleptris.so +0 -0
  6. data/lib/leptris/vendor/arm-linux-musl/libleptris.so +0 -0
  7. data/lib/leptris/vendor/arm64-darwin/libleptris.dylib +0 -0
  8. data/lib/leptris/vendor/ppc64le-linux/libleptris.so +0 -0
  9. data/lib/leptris/vendor/s390x-linux-musl/libleptris.so +0 -0
  10. data/lib/leptris/vendor/x86_64-darwin/libleptris.dylib +0 -0
  11. data/lib/leptris/vendor/x86_64-linux/libleptris.so +0 -0
  12. data/lib/leptris/vendor/x86_64-linux-musl/libleptris.so +0 -0
  13. data/lib/leptris/version.rb +1 -1
  14. data/vendor-src/README.md +1 -1
  15. data/vendor-src/libleptris/CHANGELOG.md +21 -0
  16. data/vendor-src/libleptris/CMakeLists.txt +1 -1
  17. data/vendor-src/libleptris/src/include/leptris.h +2 -2
  18. data/vendor-src/libleptris/src/leptris/core.c +2 -2
  19. data/vendor-src/libleptris/src/leptris/xpath/evaluator.c +102 -41
  20. data/vendor-src/libleptris/src/leptris/xsd/compile.c +213 -21
  21. data/vendor-src/libleptris/src/leptris/xsd/validate.c +83 -30
  22. data/vendor-src/libleptris/src/leptris/xsd/xsd_internal.h +27 -0
  23. data/vendor-src/libleptris/test/CMakeLists.txt +31 -0
  24. data/vendor-src/libleptris/test/memory/test_synth_graveyard.cpp +207 -0
  25. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs92_w3c/elemT058.xml +11 -0
  26. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs92_w3c/elemT058.xsd +115 -0
  27. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs92_w3c/elemT071.xml +4 -0
  28. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs92_w3c/elemT071.xsd +72 -0
  29. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs97_w3c/addB034.xml +1 -0
  30. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs97_w3c/addB034.xsd +13 -0
  31. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs97_w3c/addB136.xml +4 -0
  32. data/vendor-src/libleptris/test/xsd/libxml2-cases/rs97_w3c/addB136.xsd +15 -0
  33. data/vendor-src/libleptris/test/xsd/test_rs92_regression.cpp +106 -0
  34. data/vendor-src/libleptris/test/xsd/test_rs97_regression.cpp +132 -0
  35. data/vendor-src/libleptris/test/xsd/test_xsd11_cta_set.cpp +201 -0
  36. data/vendor-src/libleptris/test/xsd/test_xsd11_opencontent_set.cpp +245 -0
  37. data/vendor-src/libleptris/test/xsd/xsd-dispositions/README.md +8 -3
  38. data/vendor-src/libleptris/vcpkg.json +1 -1
  39. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5ac3f200b8de15be3edf6c729815638ea4b0b8e478573ec72df42fe144bc56f
4
- data.tar.gz: 95cf9d2ee31c0b58a23aa1b399686ddbcb3f8549251cee13f28866691b744035
3
+ metadata.gz: 1ebbc7d59e4d4ca72537028f758a0c565ccf3aaa036f95341a0d05a7018fd48f
4
+ data.tar.gz: e65e75418590acb10c6ea5e33971782eb0f38cf01b9b939a63aff1631b627208
5
5
  SHA512:
6
- metadata.gz: 5f80195b8955bc5169ed524a742b9f9a11faa1b9023d6c1809189e79a401be1fd3327f0fad7f029545b4fe49569c6cd7303372f6470386253a34449f9851e025
7
- data.tar.gz: 24ff4d64ab2f8cead7379787aedca0c0a188fbc43d92793cc214afcf277e8a320771f0a2ff16d13f68c074847952bbe2546fdb902d8c38c795b4eb2fd5f41527
6
+ metadata.gz: 045640535b63e836c17f1a7c40f227c8ee2e7e8e3f220c3b347b7bee73ffb5a1be4de55ca691ba07898843ef1fb399485c0e2016df47031795225672eefdd261
7
+ data.tar.gz: 74fa89ccdd70f53849bc12c0da0616d74268b8326a4b0c3e0d23d830143c4a24701efee4a354ee31707d35c851275dc4cc375411760f60ed477b69124f7a7006
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  # Pin for `rake compile` and the platform-gem builds. Keep in lockstep
9
9
  # with .github/workflows/build.yml (which calls `rake compile`) and the
10
10
  # CHANGELOG when libleptris releases.
11
- LIBLEPTRIS_VERSION = "1.9.456"
11
+ LIBLEPTRIS_VERSION = "1.9.458"
12
12
 
13
13
  # THE SSOT for the per-minor native bundle list (ruby#645): one line,
14
14
  # space-separated, consumed by the Rakefile, the per-minor builder's
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.456.0"
4
+ VERSION = "1.9.458.0"
5
5
  end
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.456
4
+ - libleptris v1.9.458
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,26 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.458] - 2026-12-01
4
+
5
+ ### Fixed
6
+
7
+ - **The serialbench CI-leg deaths — root cause found, and it predates the whole suspect window** (#2265, PR #2269). A Linux-container differential (serialbench-shaped driver, verbatim fixtures and schedule) between v1.9.448 and v1.9.456 showed byte-identical growth — +938,912 KB arena-live on the xslt30-medium leg on BOTH — proving the defect shipped long before 449. The culprit is 1.9.428's dispose-parking change (8a19a0ba): every disposed owned synthetic node (attribute/namespace/text) parked on an **uncapped thread-local graveyard** drained only at thread exit, replacing the real free. The serialbench xml leg's xslt30 op carries `$labels` through `xsl:iterate` + `xsl:next-iteration`, so the engine rebuilds the accumulated sequence per item — O(n²) disposals, **~190 MB parked per apply**, TLS-rooted (LSan and leaks(1) both blind to it), and Linux glibc retains the freed pages until the runner OOMs ~6 minutes into the leg. This is why 1.9.385 passes 46/46, why every 44x+ wave died, why the #2246 fix changed nothing, and why the darwin probes looked clean. Fix: the graveyard is a **bounded ring** (`SYNTH_PARK_CAP 4096`, ~500 KB/thread) — newest disposals keep the 428 alias shield unchanged; the entry that falls off the ring pays the pre-428 real free, sound under the same commit's ownership-flag law. Post-fix: +372 KB on the same leg, zero delta on all later legs, full-size run completes at 48 MB RSS where it previously died inside one apply; ASAN clean. The permanent gate (`test/memory/test_synth_graveyard.cpp`) was proven RED on both anchors at ~370× the 512 KB/op bound and GREEN post-fix on Linux and darwin. The issue's three named candidates (attr fast path, packed TLS memo, XSD caches) are exonerated in the PR with evidence.
8
+
9
+ - **Attribute-prohibition false-rejects on 1.9.457** (leptris-rs#97, PR #2268). The issue's bisect attribution pointed at #2262, but the real culprit is **#2185 (v1.9.449)**: its present-rejection in `validate_attributes` made a `use="prohibited"` attribute declaration govern instance attributes — yet XSD 1.0 §3.2.2 says a local prohibited declaration "corresponds to nothing at all" (§3.4.2 Note: no interaction with wildcards). The suite pins both consequences: attruse_0_2 (prohibited, no wildcard) stays INVALID — the attribute is undeclared — while addB034.v/addB136.v (prohibited beside `anyAttribute ##local lax`) are VALID — the wildcard admits. Prohibited rows are now inert everywhere: skipped in the declared-row walk, never declaring for the strict walk (`attr_row_admits`), and a restriction's prohibited spelling still EXCLUDES the base's same-name use from the derived {attribute uses} (§3.4.2 cl. 3.2 — cta0044.n01 stays invalid; the #1923 chain walk must not resurrect it). Extensions keep every folded base use (derivation-ok-extension_0's twin stays valid). Full-corpus sweep: all 8 schemas carrying prohibited+wildcard validate per pinned verdict. rs#92's elemT058/elemT071 regressions remain green and untouched.
10
+
11
+ - **CTA union-selector alternatives and openContent suffix through the schema-set face** (#2266 + #2267, PR #2270; consumer issues lutaml/moxml#622/#625). Both families failed for the same reason: `leptris_xsd_compile_set` — moxml's multi-schema entry — never ran the per-document machinery the file face always ran. The version + 1.1-evidence preamble never armed, so an inline alternative type's `xs:assert` silently vanished through `xsd_set` (ibm test3_2 accepted B=11 against `B mod 2 = 0`) and the openContent capture gate (`version_11 || saw_open_content`) never fired — sets compiled with NO suffix wildcard, the exact filed verdict "children do not match the content model (at 'extra')" on valid open001.v1. The set face now reads the version dials from the first member (entry-root contract), OR-re-arms the 1.1-evidence flags per member (include-chase posture), registers each member as its own unit (the chase's first push collided with unit 0, fusing per-unit defaultAttributes scoping — open044/045), and runs `xsd_oc_finalize` (open027/047 derivation) and `xsd_apply_default_attrs` (open201/202/205/035/044) in the single-doc order. The Linux ASAN CI gate caught the late defaultAttributes pass walking member DOM that `xsd_set` callers free after their compile step — fixed at the root by capturing the per-unit targetNamespace and group wildcards while each document is alive (stash on the def, `elem_live` gate; no document-retention contract change). Set-face sweeps verdict-identical with the file face: cta 69/69, openContent 130/130, assertions 164/164. +18 specs, red-first.
12
+
13
+ Floors byte-exact on every change: **XSD 1.1 = 2206/2206 (100%)** — assertions 296/296, cta 125/125, override 87/87, openContent 205/205, core 1493/1493; **XSD 1.0 = 1046/1056** (10 pinned reds intact). Full suite 2756 green (3 pre-existing skips). The bindings ride in lockstep (gem 1.9.458.0, PyPI 1.9.458.0, npm 0.1.95).
14
+
15
+ ## [1.9.457] - 2026-11-30
16
+
17
+ ### Fixed
18
+
19
+ - **xsi:type substitution false-rejects — the consumer regression from the 1.9.449..456 window** (#2262; found by lutaml-xsd's ride battery, which dropped from 39/39 to 37/39 across the trains, leptris-rs#92). Two defects in the #2184 substitutability arm: (1) an unprefixed xsi:type LOCAL name was canonized to the "xs:" builtin spelling unconditionally, so schema-local types walked the builtin derivation lane where a builtin can never derive from a local type (elemT058: restriction-under-block="extension", extension-under-block="restriction", and the same-type-under-block="#all" identity arm, which §3.3.4 cl. 3.2.2 admits before the gate); (2) the union substitutability check admitted only DIRECT member name matches, never a type derived from a member (elemT071). Canonization now fires only for true builtins with no shadowing schema type; the union arm walks `xsd_type_derives_from` per member — the same reading cos-ct-type-substitutable already pins. Every campaign verdict holds: **XSD 1.1 = 2206/2206 (100%)**, XSD 1.0 = **1046/1056**, full suite 2734 green, and the ride battery returns to 39/39 with this train.
20
+
21
+ The bindings ride in lockstep (gem 1.9.457.0, PyPI 1.9.457.0, npm 0.1.94).
22
+
23
+
3
24
  ## [1.9.456] - 2026-11-30
4
25
 
5
26
  The competitive-performance release: three scoreboard rows attacked in one train, three gaps closed.
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.456
6
+ VERSION 1.9.458
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -4286,8 +4286,8 @@ LEPTRIS_API const char* leptris_xinclude_get_encoding(LeptrisElement include_ele
4286
4286
  * CI's export-surface gate diffs the header against the binary. */
4287
4287
  #define LIBLEPTRIS_VERSION_MAJOR 1
4288
4288
  #define LIBLEPTRIS_VERSION_MINOR 9
4289
- #define LIBLEPTRIS_VERSION_PATCH 456
4290
- #define LIBLEPTRIS_VERSION_STRING "1.9.456"
4289
+ #define LIBLEPTRIS_VERSION_PATCH 458
4290
+ #define LIBLEPTRIS_VERSION_STRING "1.9.458"
4291
4291
 
4292
4292
  /**
4293
4293
  * Get libleptris version string
@@ -21,7 +21,7 @@
21
21
  * reaches here via target_compile_definitions in src/CMakeLists.txt.
22
22
  * Fallback keeps hand-built compilers honest. */
23
23
  #ifndef LEPTRIS_VERSION
24
- #define LEPTRIS_VERSION "1.9.456"
24
+ #define LEPTRIS_VERSION "1.9.458"
25
25
  #endif
26
26
  #ifndef LEPTRIS_VERSION_MAJOR
27
27
  #define LEPTRIS_VERSION_MAJOR 1
@@ -30,7 +30,7 @@
30
30
  #define LEPTRIS_VERSION_MINOR 9
31
31
  #endif
32
32
  #ifndef LEPTRIS_VERSION_PATCH
33
- #define LEPTRIS_VERSION_PATCH 456
33
+ #define LEPTRIS_VERSION_PATCH 458
34
34
  #endif
35
35
 
36
36
  /* Thread-local allocator hooks (TODO 27/74).
@@ -510,8 +510,55 @@ void xpath_context_init_from_document(XPathContext* context) {
510
510
  #else
511
511
  #define LEPTRIS_XPATH_TLS_CACHE 1
512
512
  #endif
513
+ /* One parked synthetic node: the node keeps its payload readable
514
+ * (defined-dead), the ring slot remembers the original kind for the
515
+ * destroy. */
516
+ typedef struct ParkedSynth {
517
+ void* node;
518
+ LeptrisNodeType kind;
519
+ } ParkedSynth;
520
+
521
+ /* #2265: the graveyard is CAPPED. The serialbench ruby xml legs
522
+ * accumulated ~190MB of parked nodes PER xslt30 apply — the XSLT 3.0
523
+ * iterate param accumulation rebuilds the carried sequence every
524
+ * item, disposing the previous value's synthetic nodes each pass
525
+ * (O(n^2) disposals per transform) — and the lot had no ceiling, so
526
+ * the long-lived benchmark process grew until the 7-16GB Linux CI
527
+ * runners OOMed (~6 minutes into the xml benchmark; the TLS root
528
+ * keeps the lot reachable, so LSan and leaks(1) both report clean —
529
+ * the same blindness that masked #2246). Cap the lot at the shield's
530
+ * working-set scale: the newest SYNTH_PARK_CAP disposals stay parked
531
+ * exactly as 1.9.428+ (the alias shield, dispose contract
532
+ * unchanged); the entry that falls off the ring — the OLDEST parked
533
+ * node, whose alias window is long closed — pays the pre-428 real
534
+ * free, sound under the same commit's ownership-flag law (the five
535
+ * eager-flag sites moved to synth-append branches). Per-thread
536
+ * ceiling: 4096 slots x 24B + payload ~= 500KB. */
537
+ #define SYNTH_PARK_CAP 4096
538
+
539
+ /* The real free, shared by the ring-eviction dispose and the
540
+ * thread-exit drain (one body, one law). */
541
+ static void synth_node_destroy(void* node, LeptrisNodeType kind) {
542
+ if (kind == LEPTRIS_NODE_ATTRIBUTE) {
543
+ LeptrisAttributeNode* attr = (LeptrisAttributeNode*)node;
544
+ LEPTRIS_FREE(attr->name);
545
+ LEPTRIS_FREE(attr->value);
546
+ LEPTRIS_FREE(attr->namespace_uri);
547
+ LEPTRIS_FREE(attr);
548
+ } else if (kind == LEPTRIS_NODE_NAMESPACE) {
549
+ LeptrisNamespaceNode* ns = (LeptrisNamespaceNode*)node;
550
+ LEPTRIS_FREE(ns->prefix);
551
+ LEPTRIS_FREE(ns->uri);
552
+ LEPTRIS_FREE(ns);
553
+ } else {
554
+ XPathTextNode* t = (XPathTextNode*)node;
555
+ LEPTRIS_FREE(t->content);
556
+ LEPTRIS_FREE(t);
557
+ }
558
+ }
559
+
513
560
  /* TLS consolidation (#682 lever 2): one thread-local object for
514
- * all four free-list variables. Each separate __thread variable
561
+ * all free-list variables. Each separate __thread variable
515
562
  * costs its own tlv_get_addr thunk per access; members of a single
516
563
  * struct share one hoisted address per function. */
517
564
  static LEPTRIS_THREAD_LOCAL struct {
@@ -519,8 +566,15 @@ static LEPTRIS_THREAD_LOCAL struct {
519
566
  size_t nodeset_count;
520
567
  struct leptris_xpath_result* result_head;
521
568
  size_t result_count;
522
- void* synth_parked_head;
523
- size_t synth_parked_count;
569
+ /* #2265: the synthetic graveyard is a bounded RING of disposed
570
+ * owned nodes — the newest SYNTH_PARK_CAP disposals stay
571
+ * readable (defined dead); the entry that falls off the ring is
572
+ * destroyed for real (pre-428 law). The ring array is allocated
573
+ * on first park — threads that never dispose synth nodes never
574
+ * pay for it. */
575
+ ParkedSynth* park_ring;
576
+ size_t park_head; /* oldest occupied slot */
577
+ size_t park_count;
524
578
  } g_xpath_tls;
525
579
 
526
580
 
@@ -531,15 +585,6 @@ static LEPTRIS_THREAD_LOCAL struct {
531
585
  * to the struct). */
532
586
  #define XPATH_RESULT_FREE_LIST_CAP 32
533
587
 
534
- /* One parked synthetic node: the node keeps its payload readable
535
- * (defined-dead), the wrapper remembers the original kind for the
536
- * drain. */
537
- typedef struct ParkedSynth {
538
- struct ParkedSynth* next;
539
- void* node;
540
- LeptrisNodeType kind;
541
- } ParkedSynth;
542
-
543
588
  XPathNodeSet* xpath_nodeset_new(void) {
544
589
  return xpath_nodeset_new_with_capacity(XPATH_NODESET_INLINE_CAPACITY);
545
590
  }
@@ -564,29 +609,18 @@ void leptris_xpath_drain_thread_caches(void) {
564
609
  g_xpath_tls.result_count = 0;
565
610
  /* The parked synthetic nodes (LEPTRIS_NODE_XPATH_PARKED): the
566
611
  * thread is exiting — no consumer can still reach them. */
567
- while (g_xpath_tls.synth_parked_head) {
568
- ParkedSynth* p = (ParkedSynth*)g_xpath_tls.synth_parked_head;
569
- g_xpath_tls.synth_parked_head = p->next;
570
- if (p->kind == LEPTRIS_NODE_ATTRIBUTE) {
571
- LeptrisAttributeNode* attr = (LeptrisAttributeNode*)p->node;
572
- LEPTRIS_FREE(attr->name);
573
- LEPTRIS_FREE(attr->value);
574
- LEPTRIS_FREE(attr->namespace_uri);
575
- LEPTRIS_FREE(attr);
576
- } else if (p->kind == LEPTRIS_NODE_NAMESPACE) {
577
- LeptrisNamespaceNode* ns = (LeptrisNamespaceNode*)p->node;
578
- LEPTRIS_FREE(ns->prefix);
579
- LEPTRIS_FREE(ns->uri);
580
- LEPTRIS_FREE(ns);
581
- } else {
582
- XPathTextNode* t = (XPathTextNode*)p->node;
583
- LEPTRIS_FREE(t->content);
584
- LEPTRIS_FREE(t);
612
+ if (g_xpath_tls.park_ring) {
613
+ for (size_t i = 0; i < g_xpath_tls.park_count; i++) {
614
+ size_t idx =
615
+ (g_xpath_tls.park_head + i) % SYNTH_PARK_CAP;
616
+ ParkedSynth* p = &g_xpath_tls.park_ring[idx];
617
+ synth_node_destroy(p->node, p->kind);
585
618
  }
586
- LEPTRIS_FREE(p);
587
- g_xpath_tls.synth_parked_count--;
619
+ LEPTRIS_FREE(g_xpath_tls.park_ring);
620
+ g_xpath_tls.park_ring = NULL;
588
621
  }
589
- g_xpath_tls.synth_parked_count = 0;
622
+ g_xpath_tls.park_head = 0;
623
+ g_xpath_tls.park_count = 0;
590
624
  }
591
625
 
592
626
  XPathNodeSet* xpath_nodeset_new_with_capacity(size_t capacity) {
@@ -650,7 +684,14 @@ XPathNodeSet* xpath_nodeset_new_with_capacity(size_t capacity) {
650
684
  * still held it; the axis step read freed memory). The dispose now
651
685
  * PARKS (LEPTRIS_NODE_XPATH_PARKED + the thread-local graveyard,
652
686
  * drained at thread exit): repeat-dispose and any late read see a
653
- * defined dead node instead of freed memory. */
687
+ * defined dead node instead of freed memory.
688
+ *
689
+ * #2265: the graveyard is a bounded ring (SYNTH_PARK_CAP) — see the
690
+ * cap comment at the TLS block. The incoming node ALWAYS parks (the
691
+ * dispose contract is unchanged: repeat-dispose stays the parked
692
+ * no-op); when the ring is full the OLDEST parked entry is evicted
693
+ * into synth_node_destroy, the pre-428 real free, sound under the
694
+ * ownership-flag law this shield was never meant to replace. */
654
695
  void xpath_nodeset_dispose_node(void* node) {
655
696
  if (!node) return;
656
697
  int ty = (int)XPATH_NODE_TYPE(node);
@@ -658,13 +699,33 @@ void xpath_nodeset_dispose_node(void* node) {
658
699
  if (ty != LEPTRIS_NODE_ATTRIBUTE && ty != LEPTRIS_NODE_NAMESPACE &&
659
700
  ty != LEPTRIS_NODE_TEXT)
660
701
  return;
661
- ParkedSynth* p = (ParkedSynth*)LEPTRIS_ALLOC(ParkedSynth);
662
- if (!p) return; /* un-parked: the node stays alive, leak over UAF */
663
- p->node = node;
664
- p->kind = (LeptrisNodeType)ty;
665
- p->next = (ParkedSynth*)g_xpath_tls.synth_parked_head;
666
- g_xpath_tls.synth_parked_head = p;
667
- g_xpath_tls.synth_parked_count++;
702
+ if (!g_xpath_tls.park_ring) {
703
+ g_xpath_tls.park_ring =
704
+ LEPTRIS_ALLOC_N(ParkedSynth, SYNTH_PARK_CAP);
705
+ if (!g_xpath_tls.park_ring)
706
+ return; /* un-parked: the node stays alive, leak over UAF */
707
+ memset(g_xpath_tls.park_ring, 0,
708
+ sizeof(ParkedSynth) * SYNTH_PARK_CAP);
709
+ }
710
+ if (g_xpath_tls.park_count == SYNTH_PARK_CAP) {
711
+ /* Ring full: the OLDEST parked node leaves the shield (its
712
+ * alias window is long closed) and this node takes its slot
713
+ * as the newest. */
714
+ ParkedSynth* slot = &g_xpath_tls.park_ring[g_xpath_tls.park_head];
715
+ synth_node_destroy(slot->node, slot->kind);
716
+ slot->node = node;
717
+ slot->kind = (LeptrisNodeType)ty;
718
+ g_xpath_tls.park_head =
719
+ (g_xpath_tls.park_head + 1) % SYNTH_PARK_CAP;
720
+ } else {
721
+ size_t tail =
722
+ (g_xpath_tls.park_head + g_xpath_tls.park_count) %
723
+ SYNTH_PARK_CAP;
724
+ ParkedSynth* slot = &g_xpath_tls.park_ring[tail];
725
+ slot->node = node;
726
+ slot->kind = (LeptrisNodeType)ty;
727
+ g_xpath_tls.park_count++;
728
+ }
668
729
  XPATH_NODE_TYPE(node) = LEPTRIS_NODE_XPATH_PARKED;
669
730
  }
670
731