On Sunday, October 5, 2025, Frederick Virchanza Gotham wrote:
Again this code hasn't been ruminated over again and again, but
something along the lines of this:
https://gcc.godbolt.org/z/6KK8oafcd
Also take a look at boost::thread_specific_ptr and Poco::ThreadLocal.
You could probably take the implementations of these classes, feed them into an LLM and ask it to remove the dynamic memory allocation (e.g. replace it with a pool).