This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::time::Instant; | |
/// # Safety | |
/// | |
/// * `ptr` must be [valid] for writes. | |
/// * `ptr` must be properly aligned. | |
#[inline(always)] | |
pub unsafe fn store_advance_aligned<T>(val: T, ptr: &mut *mut T) { | |
unsafe { | |
std::ptr::write(*ptr, val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use criterion::{criterion_group, criterion_main, Criterion}; | |
use rand::Rng; | |
/// # Safety | |
/// | |
/// * `ptr` must be [valid] for writes. | |
/// * `ptr` must be properly aligned. | |
#[inline(always)] | |
pub unsafe fn store_advance_aligned<T>(val: T, ptr: &mut *mut T) { | |
unsafe { |