Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sizeof() for reference types

Status
Not open for further replies.

dragonwell

Programmer
Oct 21, 2002
863
US
Can the amount of bytes that an object is consuming be determined?

David
[pipe]
 
The unmanaged and managed sizes of an object can differ.
sizeof() operator applies only to value types and not reference types.
Marshal.SizeOf(object o) - where "o" could be a reference gives the size of the unmanaged object.
The size calculation of a given class that contains character type is depending on the CharSet set for this class.
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top