-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Context
PR #147 added a global interned name table (NAME_TABLE) with a thread-local cache (NAME_CACHE) for function name lookups. The reset() function clears all other thread-local state (STACK, RECORDS, REGISTERED, INVOCATIONS, FRAME_BUFFER, FRAMES) but intentionally does not clear the name cache or table.
Why it's correct
The intern table is append-only and IDs are stable -- clearing it during reset() would invalidate cached IDs in other threads' NAME_CACHE, causing stale lookups. Leaving it alone is the safer choice.
Ask
Add a brief comment in reset() explaining why NAME_CACHE and NAME_TABLE are intentionally not cleared. This aids future maintainability.
Scope
piano-runtime/src/collector.rs, reset() function (~line 776).
Reactions are currently unavailable