MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / clear_mixin_cache

Function clear_mixin_cache

src/virtual_members/phpdoc.rs:68–74  ·  view source on GitHub ↗

Clear the thread-local mixin resolution cache. In production the cache lives for the lifetime of the thread and is safe because the same FQN always maps to the same class. In tests, however, each test may define classes with identical short names but different members. Call this function when creating a new test backend so that stale entries from a previous test do not leak.

()

Source from the content-addressed store, hash-verified

66/// different members. Call this function when creating a new test
67/// backend so that stale entries from a previous test do not leak.
68pub fn clear_mixin_cache() {
69 MIXIN_CACHE.with(|cache| {
70 let mut inner = cache.borrow_mut();
71 inner.0 = MIXIN_GENERATION.load(Ordering::Relaxed);
72 inner.1.clear();
73 });
74}
75
76/// Ensure the thread-local cache is current with the global generation.
77/// Clears the cache if stale.

Calls 1

loadMethod · 0.45