Skip to main content

v2_release

Function v2_release 

Source
pub unsafe fn v2_release(ptr: *const HeapHeader) -> bool
Expand description

Decrement the reference count of a v2 heap object. Returns true if the count reached zero (caller must deallocate).

Uses Release ordering on the decrement and an Acquire fence when the count reaches zero, ensuring all prior writes are visible before deallocation.

ยงSafety

ptr must point to a valid, live HeapHeader. If this returns true, the caller must deallocate the object and must not access it again.