Function ruby_xfree

Source
pub unsafe extern "C" fn ruby_xfree(ptr: *mut c_void)
Expand description

Deallocates a storage instance.

ยง@param[out] ptr Either - NULL, or - a valid pointer previously returned from one of: - ruby_xmalloc(), - ruby_xmalloc2(), - ruby_xcalloc(), - ruby_xrealloc(), or - ruby_xrealloc2(). @pre The passed pointer must point to a valid live storage instance. It is a failure to pass an already freed pointer. @post The storage instance pointed by the passed pointer gets invalidated; it is no longer addressable. @warning Every single storage instance that was previously allocated by either ruby_xmalloc(), ruby_xmalloc2(), ruby_xcalloc(), ruby_xrealloc(), or ruby_xrealloc2() shall be invalidated exactly once by either passing it to ruby_xfree(), or passing it to either ruby_xrealloc(), ruby_xrealloc2() then check the return value for invalidation. @warning Do not pass anything other than pointers described above. For instance pointers returned from malloc() or mmap() shall not be passed to this function, because the underlying memory management mechanism could differ. @warning Do not pass any invalid pointers to this function e.g. by calling it twice with a same argument.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3