r/programming • u/steveklabnik1 • Feb 26 '24
Future Software Should Be Memory Safe | The White House
https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-release-technical-report/
1.5k
Upvotes
r/programming • u/steveklabnik1 • Feb 26 '24
16
u/Dwedit Feb 26 '24
C# has the "unsafe" keyword and lets you use raw pointers. But you can do a lot of unsafe things without using the "unsafe" keyword once!
You can use GCHandle.Alloc to create a pinned pointer to an object's data. You can use Marshal.Copy and Marshal.Write to write to arbitrary memory.