Use stackalloc for log callback alloc when possible
Problem to solve
Improve memory/perf for log callback
Intended users
Anyone that listens to log events
Proposal
Replace heap alloc calls by stack alloc calls when possible. Depending on process size and needed buffer size to allocate, notably.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/stackalloc
Would be curious to see the result of both versions with benchmarkdotnet.
Documentation
None