Merge pull request 'Avoid wiping full error context on release' (#27) from 26 into main
Reviewed-on: #27
This commit was merged in pull request #27.
This commit is contained in:
@@ -132,6 +132,11 @@ One recursive lock covers both the pool and the registry, so error
|
||||
correctness there is worth more than throughput, but a program that raises
|
||||
errors in a hot loop will feel it.
|
||||
|
||||
Releasing the last reference to a context remains serialized under that same
|
||||
pool lock, but it now resets only the handled/status/reported state, the string
|
||||
heads, and the stack-trace cursor. It no longer wipes the whole context buffer,
|
||||
so release is a fixed handful of stores rather than a tens-of-kilobytes write.
|
||||
|
||||
The per-thread last-ditch context is a whole `akerr_ErrorContext` (tens of
|
||||
kilobytes) in thread-local storage, allocated per thread on first use of the
|
||||
library from that thread.
|
||||
|
||||
Reference in New Issue
Block a user