1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! # Atomic AVL Tree Node
//!
//! Single-element container for balanced binary search tree traversal.
//!
//! ## License & Attribution
//! SPDX-License-Identifier: MIT | Author: Dzulkifli Anwar | Version: 0.1.0 | Date: 2026-04-30
use AtomicPtr;
/// # AVL Tree Node
///
/// Stores key, value, height, and left/right child pointers.
///
/// ## Description
/// Maintains height invariant for AVL balancing. Child pointers use atomic types.
/// Structure aligns to cache line to prevent false sharing. Arena allocator manages lifetime.
///
/// ## Invariant
/// `height == max(left.height(), right.height()) + 1`
///
/// ## Thread Safety
/// `left_child` and `right_child` support concurrent reads. Writers replace entire subtree.
///
/// ## Performance
/// Cache-line aligned. Zero dynamic allocation post-construction. Trivially copyable keys/values preferred.
///
/// ## See Also
/// `crate::memory::arena::GenerationalArena`