use redline::redline;

#[redline(latency = "< 1ms")]
fn add(a: u64, b: u64) -> u64 {
    a + b
}

#[redline(allocs = 0)]
fn multiply(a: f64, b: f64) -> f64 {
    a * b
}

#[redline(syscalls = 0)]
fn compute(x: i32) -> i32 {
    let y = x * 2;
    let z = y + 10;
    z / 3
}

#[redline(latency = "< 100us", allocs = 0, syscalls = 0)]
fn hot_loop(data: &[u8]) -> u64 {
    let mut sum: u64 = 0;
    for i in 0..100 {
        sum += data.get(i).copied().unwrap_or(0) as u64;
    }
    sum
}

fn main() {}
