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
{{ message }}
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.
Marshal.SizeOf returns the size of the unmanaged view of the struct. sizeof returns the size of the managed view of the struct.
Unmanaged and managed views are identical for the blittable structs. It is better to use sizeof instead of Marshal.SizeOf for blittable structs. They return the same number and sizeof is much cheaper.
`sizeof(T)` is much faster than `Marshal.SizeOf<T>`, but it can only be safely used when `T` is a blittable type. This means all members are value types and have no `MarshalAs` attribute on them. This rule is recursive for all members.
Closes#475
`sizeof(T)` is much faster than `Marshal.SizeOf<T>`, but it can only be safely used when `T` is a blittable type. This means all members are value types and have no `MarshalAs` attribute on them. This rule is recursive for all members.
Closes#475
`sizeof(T)` is much faster than `Marshal.SizeOf<T>`, but it can only be safely used when `T` is a blittable type. This means all members are value types and have no `MarshalAs` attribute on them. This rule is recursive for all members.
Closes#475
Marshal.SizeOf
returns the size of the unmanaged view of the struct.sizeof
returns the size of the managed view of the struct.Unmanaged and managed views are identical for the blittable structs. It is better to use
sizeof
instead ofMarshal.SizeOf
for blittable structs. They return the same number andsizeof
is much cheaper.Originally posted by @jkotas in #463
Since all our structs are (or should be) blittable, we should confirm each one and replace the slow method with the faster keyword.
The text was updated successfully, but these errors were encountered: