1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use tracy_client::sys::{
    ___tracy_c_zone_context, ___tracy_emit_zone_begin_alloc, ___tracy_emit_zone_end,
};

extern "C" {
    pub fn profiler_entry();
    pub fn profiler_exit();
}

#[no_mangle]
pub extern "C" fn __profiler_begin(name: u64) -> ___tracy_c_zone_context {
    unsafe { ___tracy_emit_zone_begin_alloc(name, 1) }
}

#[no_mangle]
pub extern "C" fn __profiler_end(ctx: tracy_client::sys::___tracy_c_zone_context) {
    unsafe { ___tracy_emit_zone_end(ctx) }
}