I see that some C libraries have ability to specify custom memory allocators (malloc/free replacements).
- In what systems/environments/conditions is that useful? Isn’t this feature just a leftover from MSDOS era or similar no-longer-relevant problems?
Background story:
I’m planning to make pngquant a library that can be embedded in various software (from iOS apps to Apache modules). I’m using malloc()/free() and my own memory pools for small allocations. I use 2MB-50MB of memory in total. I use threads, but only need to alloc on the main thread.
In any application where control over memory allocation is critical (for example my field, game development, or other real or near real time systems) the inability to control memory allocations in a library immediately disqualifies it from use.