concurrent_avl_tree 0.1.0

Lock-free readable AVL tree with epoch-based reclamation and background batch rebalancing.
Documentation
//! # Compile-time Configuration Constants
//!
//! Defines memory alignment, epoch limits, chunk boundaries, and atomic memory order defaults.
//! Values remain constant after compilation. Modifying requires rebuild.
//!
//! ## License & Attribution
//! SPDX-License-Identifier: MIT | Author: Dzulkifli Anwar | Version: 0.1.0 | Date: 2026-04-30

/// # Cache Line Alignment
///
/// Byte boundary for false-sharing prevention. Matches x86/ARM L1 cache line size.
///
/// ## Note
/// Evaluate with `std::hint::spin_loop` or hardware-specific intrinsics when available.
pub const CACHE_LINE_ALIGNMENT: usize = {
    if cfg!(any(target_arch = "aarch64", target_arch = "s390x", target_vendor = "apple")) {
        128
    } else {
        64
    }
};

/// # Max Active Epochs
///
/// Upper bound for concurrent epoch tracking. Limits epoch ring buffer size.
/// Prevents unbounded allocation.
///
/// ## Note
/// Value must exceed maximum concurrent thread count in deployment environment.
pub const MAX_ACTIVE_EPOCHS: usize = 256;

/// # Batch Chunk Size
///
/// Element count per parallel merge segment. Determines thread partition granularity.
///
/// ## Note
/// Optimal value depends on core count and memory bandwidth.
pub const BATCH_CHUNK_SIZE: usize = 4096;