MCPcopy Index your code
hub / github.com/RustPython/RustPython / gc_state

Function gc_state

crates/vm/src/gc_state.rs:863–868  ·  view source on GitHub ↗

Get a reference to the GC state. In threading mode this is a true global (OnceLock). In non-threading mode this is thread-local, because PyRwLock/PyMutex use Cell-based locks that are not Sync.

()

Source from the content-addressed store, hash-verified

861/// In non-threading mode this is thread-local, because PyRwLock/PyMutex
862/// use Cell-based locks that are not Sync.
863pub fn gc_state() -> &'static GcState {
864 rustpython_common::static_cell! {
865 static GC_STATE: GcState;
866 }
867 GC_STATE.get_or_init(GcState::new)
868}
869
870#[cfg(test)]
871mod tests {

Callers 15

enableFunction · 0.85
disableFunction · 0.85
isenabledFunction · 0.85
collectFunction · 0.85
get_thresholdFunction · 0.85
set_thresholdFunction · 0.85
get_countFunction · 0.85
get_debugFunction · 0.85
set_debugFunction · 0.85
get_statsFunction · 0.85
get_objectsFunction · 0.85
get_referrersFunction · 0.85

Calls 1

get_or_initMethod · 0.45

Tested by

no test coverage detected