3 ms·
For objects allocated at phase 1 and not necessary after, I would use std::monotonic_buffer_resource added in C++17. It's implementation is consists of just a
by ezoe 7y ago
For objects allocated at phase 1 and not necessary after,
I would use std::monotonic_buffer_resource added in C++17. It's implementation is consists of just a pointer point to large contagious memory. You want a n bytes of memory? return the pointer while adding ptr += n. Deallocation do nothing. Destructing std::monotonic_buffer_resource object deallocate the memory. If the objects has trivial destructor, as that is the case based on glancing the code, this is very efficient.