4 ms·
Good question. For fds their Drop implementation closes them, yes. Rust Mutexes will be poisoned on panic (not unlocked). Not sure about futexes.
by diarrhea 11mo ago
Good question. For fds their Drop implementation closes them, yes. Rust Mutexes will be poisoned on panic (not unlocked). Not sure about futexes.
- reactordev 11mo agoBut if Rust panic’s, the entire process is dead, so everything gets reclaimed on exit by the kernel. Total annihilation. All modern OS’s behave this way. When your process starts and is assigned an address, you get an area. It can balloon but it starts somewhere. When the process ends, that area is reclaimed.
- diarrhea 11mo agoThe OS is my GC. It's why I segfault liberally.
- ignoramous 10mo agoI see your point. At some level serverless is popular for this reason. You can just forget about memory leaks (like Vercel does with NextJS ;) That said, the OS can be a lousy GC; for instance, POSIX-compliant Kernels may not clean up shm regions after processes.