Implement malloc_usable_size

This commit is contained in:
Wildan M
2026-01-04 02:15:29 +07:00
parent 7f1bbc7426
commit 7d1c3961b5
7 changed files with 48 additions and 0 deletions
+6
View File
@@ -40,3 +40,9 @@ pub unsafe extern "C" fn pvalloc(size: size_t) -> *mut c_void {
}
}
}
/// See <https://man7.org/linux/man-pages/man3/malloc_usable_size.3.html>.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn malloc_usable_size(ptr: *mut c_void) -> size_t {
platform::alloc_usable_size(ptr)
}