Skip to main content

clone_shared

Function clone_shared 

Source
pub unsafe fn clone_shared<T>(payload: ValuePayload) -> ValuePayload
where T: Clone + PartialEq + Display + Debug + Send + Sync + 'static,
Expand description

Shared-heap clone: bump the Arc strong count, sharing the buffer. O(1) with no allocation.

ยงSafety

The payload must co-own an Arc<T> buffer minted by Value::mint_heap_shared and cloned only through this hook, so one outstanding strong count exists per live word.