Last active
July 16, 2022 23:46
-
-
Save BinToss/4ee6f3bf7ee5532f8f4dd9c5bbff215f to your computer and use it in GitHub Desktop.
Auto-implemented properties add type-specific size to unmanaged struct as if they were fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Auto-implemented properties add type-specific size to unmanaged struct | |
/// (via Visual Studio Code extension ".NET Interactive" | |
struct tmp{ | |
public nuint pp{get;set;} | |
} | |
System.Runtime.InteropServices.Marshal.SizeOf<tmp>().Display(); | |
// 8 bytes on 64-bit runtime | |
// 4 bytes on 32-bit runtime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment