Is it possible to list all instances of a class? I don't mean definitions, I mean allocated declarations of a class. Reflection is typically used to get a list of classes defined but that is not what I am asking for.
This is for educational purposes. I want to list all instances of a specific class (such as the string class) to learn about that class. Actually, I want to list all instances of the WPF Binding class since that will help me understand how bindings work in WPF. This however is not a WPF question.
Update: I don't think that c# - How do I get all instances of all loaded types that implement a given interface? answers the question. It says that walking the heap or stack might be possible but there are no details of how to do that. I don't need detailed code but I am asking for more guidance than saying to walk the heap or stack.
I have found the following suggestions:
I am not familiar with any of those but I can learn if it will help here. I will however appreciate reasonable assurance that it is worth the time to pursue something.
Also, I know C++ and I am familiar with Detours (as in my Detours Introduction). If Detours can be used then a hint about what to detour would help.