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
//! Compile-Time Specialization Hints
//!
//! > *"Specialis notitia celeritatem affert."*
//! > — Specialized knowledge brings speed. (Optimization maxim)
//!
//! This module provides compile-time hints and markers for specialization,
//! helping the compiler generate optimal code for effect handlers.
//!
//! # Overview
//!
//! Rust's monomorphization creates specialized versions of generic code,
//! but sometimes the compiler needs hints to optimize effectively. This
//! module provides:
//!
//! - **Specialization markers** - Guide monomorphization decisions
//! - **Inline hints** - Control function inlining for fusion
//! - **Size hints** - Help the compiler with layout optimizations
//! - **Branch hints** - Guide branch prediction
//!
//! # Usage
//!
//! ```rust
//! use ordofp_core::specialization::{likely, cold_path};
//!
//! fn handle_error(x: i32) -> i32 {
//! -x
//! }
//!
//! fn process(x: i32) -> i32 {
//! if likely(x > 0) {
//! // Hot path - optimized for this case
//! x * 2
//! } else {
//! // Cold path
//! cold_path(|| handle_error(x))
//! }
//! }
//!
//! assert_eq!(process(5), 10);
//! assert_eq!(process(-5), 5);
//! ```
pub use *;
pub use *;
pub use *;