|
|
Log in / Subscribe / Register

Beingessner: Rust's Unsafe Pointer Types Need An Overhaul

Beingessner: Rust's Unsafe Pointer Types Need An Overhaul

Posted Mar 22, 2022 1:26 UTC (Tue) by tialaramex (subscriber, #21167)
In reply to: Beingessner: Rust's Unsafe Pointer Types Need An Overhaul by jlombera
Parent article: Beingessner: Rust's Unsafe Pointer Types Need An Overhaul

The Right Thing™ in your scenario is atomics. Asking for volatile and expecting atomics is mostly not dangerous on Windows, using Microsoft's C++ compiler.

On other platforms, with other compilers, you get what you asked for, not what you expected. Maybe you get lucky and maybe you don't. Maybe if you get unlucky you can write "volatile" in a few extra places and now it works. Voodoo.


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds