pub unsafe fn memory_deallocate(pointer: *mut c_void)Expand description
Deallocates a previously allocated memory block.
This function frees memory that was previously allocated using memory_allocate
or memory_reallocate. It’s safe to call this function with a null pointer.
§Safety
- The pointer must have been returned by a previous call to
memory_allocateormemory_reallocate - The pointer must not be used after this function returns
§Parameters
Pointer- Pointer to the memory block to deallocate, or null
§Examples
void* ptr = memory_allocate(NULL, 1024, 8, 0);
memory_deallocate(ptr); // Free the memory
memory_deallocate(NULL); // Safe - ignored