3 ms·
FTA: “You can't free the memory within the Arena. You have to wait and free the entire buffer at once. This is only good for certain workloads and not great for
by Someone 2y ago
FTA: “You can't free the memory within the Arena. You have to wait and free the entire buffer at once. This is only good for certain workloads and not great for a general capacity allocator.”
⇒ this isn’t really a “C++ memory allocator”. That normally is assumed to have the three calls malloc, free and realloc and to be thread-safe.
This just has the malloc, but not even in a thread-safe manner.
- jeffbee 2y agoIndeed. What this author should have compared against is not `malloc` but `std::pmr::monotonic_buffer_resource`.
- slaghate 2y agoAuthor here - thanks for the feedback! I agree this is not an apples-to-apples comparison. I've always read about how the stack was faster than the heap when it comes to memory allocation and wanted to explore that. Will definitely look into `std::pmr::monotonic_buffer_resource` for a stack to stack comparison.