You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What API should I use to get this size? Currently I use IntPtr.Size, but this feels unstable in case some new implementation of CLR uses a different header format.
The text was updated successfully, but these errors were encountered:
@ashmind The size of an object header is always the same as the pointer size in every runtime we've ever shipped. I suppose a case could be made that we should expose the object header size as a property off of ClrRuntime, but in reality there's very, very low chances that this will ever be changed.
Looking at https://blogs.msdn.microsoft.com/seteplia/2017/05/26/managed-object-internals-part-1-layout, it seems that object address on the heap points to method table, preceded by 4 or 8 byte header.
What API should I use to get this size? Currently I use
IntPtr.Size
, but this feels unstable in case some new implementation of CLR uses a different header format.The text was updated successfully, but these errors were encountered: