UnigramDev/Unigram/develop • 80ea15f • 1 files, +36/-13
Keep the log tail in a ring buffer (#3332)
Three things were wrong with the window that ships in every crash report.
It was a List trimmed with RemoveAt(0), so once full every log call copied all
retained entries down one slot. Logging happens on hot paths; this is now an
overwrite of one slot.
Dump stored its "Bump" marker as an entry, so taking a dump evicted a real line
and a second dump left the first marker behind. It is appended to the output
instead, and Dump no longer mutates anything.
The size was an inline 50, which is under a second of ordinary logging. It is
now a named constant at 200.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
#unigram
Post #20554
100