3 ms·
GC is free to move things all over memory, though I'm not savvy enough to say why this is necessary. C# allows you to "pin" a variable to combat this. Any pinn
by mystified5016 2y ago
GC is free to move things all over memory, though I'm not savvy enough to say why this is necessary.
C# allows you to "pin" a variable to combat this. Any pinned memory will never be moved by GC, so if you pass a pointer to an object out of your managed program, the pointer address will always stay valid.
- Dwedit 2y agoIf you can't move objects around in memory, you get memory fragmentation.