Does there exist a way to allocate some memory and have some sort of callback (be it pointer to a function or signal) when the memory is being accessed (either read or written to)?
For example, if I said allocate 1mb of memory, I would like to have a way to call a function when any of that 1mb is being accessed.
The platform I'm working on is x86 Linux and writing in C/C++.