From 858b8450aeb85c9fd3fc6ebf4b2171bb193cab4e Mon Sep 17 00:00:00 2001 From: THE-Amrit-mahto-05 Date: Mon, 2 Feb 2026 19:18:47 +0530 Subject: [PATCH] Update ffi_alloc.rs --- src/rust/src/ffi_alloc.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/rust/src/ffi_alloc.rs b/src/rust/src/ffi_alloc.rs index 9a1a0b54..c2ed1615 100644 --- a/src/rust/src/ffi_alloc.rs +++ b/src/rust/src/ffi_alloc.rs @@ -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(ptr: *mut T) { if !ptr.is_null() {