> The range of memory mmap'd into a process is a superset of ranges allocated by the process--e.g. returned by malloc.
Yes, and this approach, in general, would not work with malloc/free. In this little article I didn't tell anything about malloc, but probably I should explicitly mention it in an update.
I'm not talking about any particular implementation here. The example at the end is just a toy model to demonstrate how it could be used, and it is not the real scenario. The purpose of this is just to tell that it is possible to check the pointer using this specific system call. For the real use-case scenario, this method is used by the ROOT framework to check the pointer in the C++ interpreter [1].
[1] https://github.com/root-project/root/commit/8f8c786cc4914385...