Skip to main content

c_destructor

Macro c_destructor 

Source
macro_rules! c_destructor {
    ($fn_name:ident, $c_type:ty) => { ... };
}
Expand description

Macro to generate C destructor function with pointer registry support

ยงSecurity

This macro generates a destructor that:

  1. Checks if the pointer is null
  2. Validates the pointer is registered (prevents double-free)
  3. Unregisters the pointer before freeing (prevents use-after-free)