Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/standard/native-interop/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ Pointers to structs in definitions must either be passed by `ref` or use `unsafe

✔️ DO use the C# `sizeof()` instead of `Marshal.SizeOf<MyStruct>()` for blittable structures to improve performance.

❌ DON'T depend on internal representation of struct types exposed by .NET runtime libraries unless it is explicitly documented.

❌ AVOID using classes to express complex native types through inheritance.

❌ AVOID using `System.Delegate` or `System.MulticastDelegate` fields to represent function pointer fields in structures.
Expand Down
Loading