r-rust 0.0.9

Useful tools and macros for research (WIP). Currently, a microbench probe is implemented.
Documentation
extern crate num_cpus;

const MAX_CPU_COUNT: usize = 128;

fn main() {
    let mut cpu_count = num_cpus::get();
    for (env, val) in std::env::vars() {
        if env == "SYSTEM_CPU_COUNT" {
            if let Ok(_cpu_count) = val.parse() {
                cpu_count = _cpu_count;
            }
        }
    }
    if cpu_count < 1 || cpu_count > MAX_CPU_COUNT {
        println!(
            "cargo:warning=compile-time cpu count is disabled (expected 1~{}, but found {}).",
            MAX_CPU_COUNT, cpu_count
        );
        println!("cargo:rustc-cfg=feature=\"NO_SYSTEM_CPU_COUNT\"");
    } else {
        println!("cargo:rustc-cfg=feature=\"SYSTEM_CPU_COUNT_{}\"", cpu_count);
    }
    println!("cargo:rerun-if-env-changed=SYSTEM_CPU_COUNT");
}