Problem
\env_get_entry\ always allocates a thread-local \EnvEntry\ snapshot and copies name + value into it. The snapshot is only needed when
s_buffer_active(). The non-buffered path (single-threaded, REPL, tests) pays \strdup\ + \�alue_copy\ + \�alue_alias\ for no reason.
Location: \src/env.c:720-742\
Proposed Fix
Return \env_get_entry_raw(env, name)\ directly when buffer is inactive. Audit call sites that hold the returned pointer across env mutations.
Status
Baseline still present — \env_entry_snap_alloc()\ is called at line 721 before the buffer check, so the non-buffered path still pays the snapshot cost.
Problem
\env_get_entry\ always allocates a thread-local \EnvEntry\ snapshot and copies name + value into it. The snapshot is only needed when
s_buffer_active(). The non-buffered path (single-threaded, REPL, tests) pays \strdup\ + \�alue_copy\ + \�alue_alias\ for no reason.
Location: \src/env.c:720-742\
Proposed Fix
Return \env_get_entry_raw(env, name)\ directly when buffer is inactive. Audit call sites that hold the returned pointer across env mutations.
Status
Baseline still present — \env_entry_snap_alloc()\ is called at line 721 before the buffer check, so the non-buffered path still pays the snapshot cost.