Skip to content

Commit 2a50c86

Browse files
committed
bump version to 0.15.2
1 parent c7d7473 commit 2a50c86

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "binggan"
3-
version = "0.15.1"
3+
version = "0.15.2"
44
authors = ["Pascal Seitz <pascal.seitz@gmail.com>"]
55
edition = "2021"
66
homepage = "https://github.com/pseitz/binggan"

src/bench.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ use crate::{
99
};
1010
use quanta::Clock;
1111

12+
#[inline(always)]
13+
fn clock_raw_fenced(clock: &Clock) -> u64 {
14+
atomic::compiler_fence(atomic::Ordering::SeqCst);
15+
#[cfg(all(target_arch = "x86_64", target_feature = "sse2"))]
16+
// `_rdtsc()` is not serializing; `lfence` provides the needed ordering on modern x86.
17+
unsafe {
18+
core::arch::x86_64::_mm_lfence();
19+
}
20+
let t = clock.raw();
21+
#[cfg(all(target_arch = "x86_64", target_feature = "sse2"))]
22+
unsafe {
23+
core::arch::x86_64::_mm_lfence();
24+
}
25+
atomic::compiler_fence(atomic::Ordering::SeqCst);
26+
t
27+
}
28+
1229
/// The trait which typically wraps a InputWithBenchmark and allows to hide the generics.
1330
pub trait Bench<'a> {
1431
/// Returns the number of iterations the benchmark should do

0 commit comments

Comments
 (0)