News for hackers. Stuff that matters.
Re:C Programming Guidelines by caf on Wednesday September 02, 2015 @12:02AM (#10157361)
Setting aside the wisdom of this approach, if you were going to do this why wouldn't you just use malloc() to allocate the single large arena that you're going to allocate from yourself? It's still just one free().

In other words, the malloc-versus-mmap distinction here isn't the important one, it's the custom allocator versus system allocator one.

Re:C Programming Guidelines by jeffreyrogers on Wednesday September 02, 2015 @12:08AM (#10157376)
That would work too. malloc() uses mmap() internally for large allocations, so the reason to use mmap() is just to skip all the other stuff malloc() does (which you don't care about if you have a custom allocator).