Crate clf[][src]

Expand description

Flush the cpu cache line by __builtin_clear_cache()

This crate can be used when you do benchmarks that are not dependent on the cpu cache.

Examples

Easy to use:

let a = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
clf::cache_line_flush_with_slice(&a);

or

let a = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
let begin_ptr = a.as_ptr();
let end_ptr = unsafe { begin_ptr.add(a.len()) };
clf::cache_line_flush_with_ptr(begin_ptr, end_ptr);

Functions

cache_line_flush_with_ptr

flush the cpu cache line, this parameters are pointers.

cache_line_flush_with_slice

flush the cpu cache line, this parameter is a slice.