pub unsafe extern "C" fn ddwaf_allocator_free(
alloc: ddwaf_allocator,
p: *mut c_void,
bytes: usize,
alignment: usize,
)Expand description
Releases a block of memory previously obtained via ddwaf_allocator_alloc from the same allocator.
Requirements and safety:
pmust point to memory returned by ddwaf_allocator_alloc usingalloc.bytesandalignmentmust match the values used for the allocation.- After this call, the memory referenced by
pmust no longer be accessed. - Do not mix allocators; freeing with a different allocator is undefined.
- Thread-safety depends on the allocator type; see the corresponding allocator init function for details.
@param alloc Allocator used for the original allocation. (nonnull) @param p Pointer to the memory to free. (nonnull) @param bytes Size in bytes of the original allocation. @param alignment Alignment in bytes of the original allocation.