Skip to content

Commit 7077f20

Browse files
committed
fc_util: correctly label x86_64 specific func
On other architectures different than x86_64, the function will return a dummy value. Signed-off-by: Diana Popa <[email protected]>
1 parent 5667bbe commit 7077f20

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fc_util/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ extern crate libc;
55

66
pub mod validators;
77

8-
#[cfg(target_arch = "x86_64")]
98
pub fn timestamp_cycles() -> u64 {
9+
#[cfg(target_arch = "x86_64")]
1010
// Safe because there's nothing that can go wrong with this call.
11-
unsafe { std::arch::x86_64::_rdtsc() as u64 }
11+
unsafe {
12+
std::arch::x86_64::_rdtsc() as u64
13+
}
14+
#[cfg(not(target_arch = "x86_64"))]
15+
0
1216
}
1317

1418
fn timespec_to_us(time_struct: &libc::timespec) -> u64 {

0 commit comments

Comments
 (0)