You are talking about managed memory. Let me tell you that the problem itself is not correctly posed. "Managed addresses" are not just something which is tricky to work with, never needed, or like that. The thing is: in certain sense, they don't even exist. The mapping between process linear memory of the process and CLR references is volatile and can be changed during the whole lifetime of a referenced object and all references to it. You can obtain some pointer only when you
pin the object:
https://msdn.microsoft.com/en-us/library/23acw07k%28v=vs.110%29.aspx[
^],
http://geekswithblogs.net/robp/archive/2008/08/13/speedy-c-part-3-understanding-memory-references-pinned-objects-and.aspx[
^],
http://www.narfsoft.com/blog/memory-control-in-net-pinning-down-objects[
^].
In all out discussion, you never explain the purpose of your activity; you simply go rounds. I see no evidence that you know your own purpose. If you think I'm wrong, you are more than welcome to explain this purpose. None of your explanations so far was not related to the purpose.
[EDIT]
You asked for some code sample. You can find one here:
https://msdn.microsoft.com/en-us/library/f58wzh21%28VS.80%29.aspx[
^].
Please don't tell me "this is not what I want". First, try to convince me that what you want makes sense; so far, I doubt that. That was my note, just in case.
—SA