I want to use the actual pointer address (not marked volatile) to an object to uniquely identify the object.
Is this a bad thing to do? In general does system memory management move the objects and hence it’s address about or is the pointer stable?
Thanks
Your pointer is guaranteed to remain stable for the life of the object to which it points, unless you do something to break it. The OS does indeed move things around in memory, but that’s physical memory – the virtual memory space the OS presents to your process will keep things at the same addresses.