Skip to content

Drop redundant fixed pins from UnsafeMemory.WriteRaw - #2257

Open
unsafePtr wants to merge 1 commit into
MessagePack-CSharp:masterfrom
unsafePtr:drop-redundant-fixed-unsafememory
Open

Drop redundant fixed pins from UnsafeMemory.WriteRaw#2257
unsafePtr wants to merge 1 commit into
MessagePack-CSharp:masterfrom
unsafePtr:drop-redundant-fixed-unsafememory

Conversation

@unsafePtr

Copy link
Copy Markdown
Contributor Author

@EgorBo

EgorBo commented Aug 14, 2026

Copy link
Copy Markdown

Note: our personal experience that fixed is much more safer than pinning-free ref arithmetic. The latter is more error prone to GC holes (we had a real example in dotnet/runtime), see https://learn.microsoft.com/en-us/dotnet/standard/unsafe-code/best-practices#4-invalid-managed-pointers-even-if-they-are-never-dereferenced

Chances to spot such bugs are extremely low.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants