MCPcopy Create free account
hub / github.com/CodeSentryAI/lockbud / from_instance

Method from_instance

src/interest/concurrency/atomic.rs:59–70  ·  view source on GitHub ↗
(instance: Instance<'tcx>, tcx: TyCtxt<'tcx>)

Source from the content-addressed store, hash-verified

57
58impl AtomicApi {
59 pub fn from_instance<'tcx>(instance: Instance<'tcx>, tcx: TyCtxt<'tcx>) -> Option<Self> {
60 let path = tcx.def_path_str_with_args(instance.def_id(), instance.args);
61 if ATOMIC_API_REGEX["AtomicRead"].is_match(&path) {
62 Some(AtomicApi::Read)
63 } else if ATOMIC_API_REGEX["AtomicWrite"].is_match(&path) {
64 Some(AtomicApi::Write)
65 } else if ATOMIC_API_REGEX["AtomicReadWrite"].is_match(&path) {
66 Some(AtomicApi::ReadWrite)
67 } else {
68 None
69 }
70 }
71}
72
73// AtomicPtr::store(&self, ptr: *mut T, order: Ordering)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected