Valgrind comes with C macros for exactly that kind of use case: you can inform it about the state of your custom allocator, i.e. which parts of the heap are available/forbidden when this differs from its own tracking of the system calls and malloc usage.