Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
abbiecnt committed Aug 27, 2024
1 parent 3d1ac81 commit b372f6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hook.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use core::sync::atomic::{AtomicPtr, Ordering};
use core::ptr::null_mut;
use core::sync::atomic::{AtomicPtr, Ordering};

pub trait Hook<F>: Copy {

fn hook(&self) -> HookGuard {
let self_ptr = self.as_ptr_u8();

Expand Down Expand Up @@ -44,7 +43,7 @@ where
fn trampoline(f: F) -> Closure<F> {
unsafe extern "C" fn thunk<F, R>()
where
F: FnMut(),
F: FnMut() + 'static,
{
let p = STATIC_CONTEXT.swap(null_mut(), Ordering::Relaxed) as *mut ClosureInner<F>;
((*p).data)();
Expand Down

0 comments on commit b372f6d

Please sign in to comment.