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:
- Checks if the pointer is null
- Validates the pointer is registered (prevents double-free)
- Unregisters the pointer before freeing (prevents use-after-free)