Currently memory allocation functions can only be set globally with set_memory_management_functions.
We use it to allocate separate mmap regions to a very large xml document. But this does not scale with more than one document. It is not easy to have separate memory allocators per document.
This is the enhancement request to have document specific memory allocation/deallocation functions.