crabgrind 0.2.7

Rust bindings to "Valgrind Client Request" interface
Documentation
#![doc = include_str!("../../doc/dhat.md")]
use super::{client_request, constants::dhat::AD_HOC_EVENT_DEFAULT_WEIGHT};

#[cfg(feature = "valgrind")]
use crate::bindings::CG_DHATClientRequest as CR;

use core::ffi::c_void;

#[doc = include_str!("../../doc/dhat/ad_hoc_event.md")]
#[inline(always)]
pub fn ad_hoc_event(weight: impl Into<Option<usize>>) {
    client_request!(CR::CG_DHAT_AD_HOC_EVENT, weight.into().unwrap_or(AD_HOC_EVENT_DEFAULT_WEIGHT));
}

#[doc = include_str!("../../doc/dhat/histogram_memory.md")]
#[inline(always)]
pub fn histogram_memory(addr: *const c_void) {
    client_request!(CR::CG_DHAT_HISTOGRAM_MEMORY, addr);
}