Avoid wiping full error context on release
All checks were successful
libakerror CI Build / cmake_build (push) Successful in 11m55s
libakerror CI Build / coverage (push) Successful in 14m16s
libakerror CI Build / mutation_test (push) Successful in 52m8s

This commit is contained in:
2026-08-04 11:22:55 -04:00
parent 0d6517ed5b
commit d00e0cf280
3 changed files with 48 additions and 11 deletions

View File

@@ -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.