MCPcopy Create free account
hub / github.com/NthTensor/Forte / scope_two

Function scope_two

src/scope.rs:1024–1042  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1022 /// `this` must be a pointer produced by `Arc::into_raw` on an `Arc<Self>`.
1023 ///
1024 /// This call takes ownership of exactly one strong reference count for that
1025 /// allocation, releasing it via `Arc::decrement_strong_count` internally.
1026 /// The caller must hold "ownership" of one such strong reference.
1027 unsafe fn drop_as_waker(this: *const ()) {
1028 // Rather than converting back into an arc, we can just decrement the
1029 // counter here.
1030 //
1031 // SAFETY: `this` came from `Arc::into_raw` and the caller transfers
1032 // ownership of one strong count (per the contract), so decrementing it
1033 // is sound.
1034 unsafe { Arc::decrement_strong_count(this.cast::<Self>()) };
1035 }
1036}
1037
1038// -----------------------------------------------------------------------------
1039// Scope pointer
1040
1041mod scope_ptr {
1042 //! Defines a "lifetime-erased" reference-counting pointer to a scope.
1043
1044 use alloc::boxed::Box;
1045 use core::any::Any;

Callers

nothing calls this directly

Calls 4

resize_to_availableMethod · 0.80
scopeMethod · 0.80
depopulateMethod · 0.80
spawnMethod · 0.45

Tested by

no test coverage detected