Skip to content

Instantly share code, notes, and snippets.

@Kir-Antipov
Created February 19, 2019 08:57
Show Gist options
  • Save Kir-Antipov/e7e3d07d9cd06b6ea053ddb35f28c900 to your computer and use it in GitHub Desktop.
Save Kir-Antipov/e7e3d07d9cd06b6ea053ddb35f28c900 to your computer and use it in GitHub Desktop.
Get object's pointer
object obj = new List<int> { 1, 2, 3 };
TypedReference trObj = __makeref(obj);
IntPtr ptrObj = **(IntPtr**)&trObj;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment