Function rb_sys::bindings::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(). @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.