Hacker News new | ask | show | jobs
by ComputerGuru 704 days ago
Ffi: you have a c api that exposes an item by ptr not by ref so it mustn't be moved.

Interacting with system types that rely on their address. Eg I think std uses a pin equivalent for mutex/futex on some operating systems because the kernel docs say the userland lock object must not change its address after initialization (even when not locked, which is normally the only condition and doesn’t need Pin because you can’t move something that has a reference to it).