Commit 54bfa7e2 authored by Sven Liefgen's avatar Sven Liefgen
Browse files

Cosmetics

parent 06620b44
......@@ -104,22 +104,22 @@ pub fn get_timestamp_cycle() -> u64 {
current_cycle()
}
impl TimestampTable {
/// Install a timestamp table
///
/// Allocate memory for the empty timestamp tables and store pointers in the XLAP static
pub unsafe fn install() {
ZERO = Some(Instant::now());
for ptr in XLAP.iter() {
// Create a zeroed Timestamp table
let table: TimestampTable = std::mem::zeroed();
// Stop managing the memory for the table
let table = Box::into_raw(Box::new(table));
// Store the pointer to the table in an atomic
ptr.store(table, Ordering::Release);
}
/// Install a timestamp table
///
/// Allocate memory for the empty timestamp tables and store pointers in the XLAP static
pub unsafe fn init() {
ZERO = Some(Instant::now());
for ptr in XLAP.iter() {
// Create a zeroed Timestamp table
let table: TimestampTable = std::mem::zeroed();
// Stop managing the memory for the table
let table = Box::into_raw(Box::new(table));
// Store the pointer to the table in an atomic
ptr.store(table, Ordering::Release);
}
}
impl TimestampTable {
/// Dump the collected timestamps to a csv file
pub unsafe fn dump_all(file: &str) -> std::io::Result<()> {
Self::dump(file, Kind::iter().collect::<Vec<_>>().as_slice())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment