News for hackers. Stuff that matters.
Re:Custom Allocators Demystified by 59nadir on Wednesday October 14, 2020 @04:13AM (#24774337)
> For sure, writing your own allocator is the last thing you reach for after all else fails.

Writing your own general purpose allocator might be the last thing, but custom allocators for well-understood limited/localized behavior is both trivial and something one should do even for simplification in many cases. Freeing an entire arena/resetting an allocation pointer is both much faster and simpler than `malloc`/`new` & `free`/`delete`.

People often misunderstand "custom allocators" to mean "making your own `jemalloc`" and it feels like your comment runs the risk of fueling that fire. Creating your own `jemalloc` is both wasteful in that `jemalloc` performs worse than even the most simple of custom allocators and a waste of your time in that general purpose allocators already exist so if you need something like that you probably can save your time for something else.

There are no comments on this comment yet.