MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / get

Method get

crates/rustc_codegen_spirv/src/symbols.rs:414–417  ·  view source on GitHub ↗

Obtain an `Rc` handle to the current thread's `Symbols` instance, which will be shared between all `Symbols::get()` calls on the same thread. While this is relatively cheap, prefer caching it in e.g. `CodegenCx`, rather than calling `get()` every time a field of `Symbols` is needed.

()

Source from the content-addressed store, hash-verified

412 /// While this is relatively cheap, prefer caching it in e.g. `CodegenCx`,
413 /// rather than calling `get()` every time a field of `Symbols` is needed.
414 pub fn get() -> Rc<Self> {
415 thread_local!(static SYMBOLS: Rc<Symbols> = Rc::new(Symbols::new()));
416 SYMBOLS.with(Rc::clone)
417 }
418}
419
420// FIXME(eddyb) find something nicer for the error type.

Callers 14

rebuild_pipelinesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
parse_attrs_for_checkingFunction · 0.45
parse_entry_attrsFunction · 0.45
collectMethod · 0.45
src_loc_for_idMethod · 0.45
zombie_for_idMethod · 0.45
const_fold_loadMethod · 0.45
def_with_spanMethod · 0.45
def_constant_cxMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected