[llvm] [Support/rpmalloc] Updated fake atomics with Interlocked functions (PR #148303)

Dmitry Vasilyev via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 13 04:35:03 PDT 2025


slydiman wrote:

> I'd like to see this merged upstream rpmalloc before merging it here. @slydiman Can you please send a PR there first? https://github.com/mjansson/rpmalloc/pulls
> 
> The point being, like for BLAKE3, I think we should keep in sync with upstream rpmalloc and only make integrations here into LLVM.

Thu usage of Interlocked* functions is the workaround since MSVC does not do C11.
The upstream code does not contain the section `Atomic access abstraction` at all. It just uses stdatomic.
Currently LLVM requires Visual Studio 2019 or later (no exact version specified). 
According to the doc ([Install C11 and C17 support in Visual Studio](https://learn.microsoft.com/en-us/cpp/overview/install-c17-support?view=msvc-160)) support for C11 and C17 standards is available starting in Visual Studio 2019 version 16.8. Support requires an updated Universal C Runtime (UCRT) and the latest Windows SDK updates.
So we can 
- update our copy of rpmalloc with this PR for now
- or update requirements to Visual Studio 2019 version 16.8 or later and remove the workaround with all Interlocked* functions.

https://github.com/llvm/llvm-project/pull/148303


More information about the llvm-commits mailing list