mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-09-25 08:14:59 +00:00
Update ffi_alloc.rs
This commit is contained in:
committed by
GitHub
parent
925907b75f
commit
858b8450ae
@@ -4,12 +4,7 @@ extern "C" {
|
||||
fn free(ptr: *mut c_void);
|
||||
}
|
||||
/// Frees memory allocated by C code (malloc/calloc)
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The pointer must have been allocated by C's malloc/calloc/realloc and
|
||||
/// not yet freed. Calling this function with a pointer that was not
|
||||
/// allocated by the C allocator is undefined behavior.
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn c_free<T>(ptr: *mut T) {
|
||||
if !ptr.is_null() {
|
||||
|
||||
Reference in New Issue
Block a user