Support alternative memory managers and deprecate direct calls to malloc/free
There are a handful of places where malloc and free (and related calls like realloc) are called directly to allocate memory. It would be preferable if these calls could be abstracted and alternative memory managers could be used.
Some systems pre-allocate memory in a pool to reduce allocation costs, or impose a sandbox, and use their own memory management - and in these cases calling malloc directly could cause a crash. On Windows malloc can also be slow, and there are better managers around.
It would be better to abstract these calls through function pointers, or at least use macros defined in a header so all calls could be replaced in different applications