Problem: reliance on a generic allocator
Generic allocator like malloc/free pair is not aware what it is allocating for.
However, there are scenarios where it is desirable for an allocator to be aware and allocate appropriately (for example, in different pools of memory)
Solution: introduce intention/context into allocators by providing high-level ALLOC_FN and ALLOC_FREE_FN API.
It defaults to wrappers for MALLOC_FN and FREE_FN but allows one to override to gain visibility into what's going on.
I propose to discuss this idea of being able to have a more context-sensitive allocator for custom allocation schemes where not being aware of what we're allocating for is a deal breaker.
An alternative worth exploring is using realloc instead of malloc so that at least the previous allocation is provided to the allocator, so at least some context can be shoehorned into it.
Thanks for working on this! I'll close the PR now because extended custom allocator support was added in v2.0.0.