3 ms·
That sounds interesting, could you elaborate? (what is pinning in this context?)
by magic_haze 12y ago
That sounds interesting, could you elaborate? (what is pinning in this context?)
- ygra 12y agoUsually in the managed world you have references that point to an object. The objects themselves don't live in the same place forever, they may be moved by the GC (to consolidate "holes" in memory). References reflect that movement so you don't notice. However, when using unsafe code (which has pointers and pointer arithmetic) you need to keep the objects in place. That's pinning and it essentially forces the GC to work around those islands of pinned objects.