mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
fix memory order to acq_rel for atomic and/or, issue #130, thanks @mpoeter!
This commit is contained in:
parent
70be91d6b8
commit
b74caddcc1
2 changed files with 4 additions and 4 deletions
|
@ -149,8 +149,8 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="mimalloc.vcxproj">
|
<ProjectReference Include="mimalloc-override.vcxproj">
|
||||||
<Project>{abb5eae7-b3e6-432e-b636-333449892ea6}</Project>
|
<Project>{abb5eae7-b3e6-432e-b636-333449892ea7}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
|
|
@ -215,11 +215,11 @@ static inline uintptr_t mi_atomic_add(volatile _Atomic(uintptr_t)* p, uintptr_t
|
||||||
}
|
}
|
||||||
static inline uintptr_t mi_atomic_and(volatile _Atomic(uintptr_t)* p, uintptr_t x) {
|
static inline uintptr_t mi_atomic_and(volatile _Atomic(uintptr_t)* p, uintptr_t x) {
|
||||||
MI_USING_STD
|
MI_USING_STD
|
||||||
return atomic_fetch_and_explicit(p, x, memory_order_relaxed);
|
return atomic_fetch_and_explicit(p, x, memory_order_acq_rel);
|
||||||
}
|
}
|
||||||
static inline uintptr_t mi_atomic_or(volatile _Atomic(uintptr_t)* p, uintptr_t x) {
|
static inline uintptr_t mi_atomic_or(volatile _Atomic(uintptr_t)* p, uintptr_t x) {
|
||||||
MI_USING_STD
|
MI_USING_STD
|
||||||
return atomic_fetch_or_explicit(p, x, memory_order_relaxed);
|
return atomic_fetch_or_explicit(p, x, memory_order_acq_rel);
|
||||||
}
|
}
|
||||||
static inline bool mi_atomic_cas_weak(volatile _Atomic(uintptr_t)* p, uintptr_t desired, uintptr_t expected) {
|
static inline bool mi_atomic_cas_weak(volatile _Atomic(uintptr_t)* p, uintptr_t desired, uintptr_t expected) {
|
||||||
MI_USING_STD
|
MI_USING_STD
|
||||||
|
|
Loading…
Add table
Reference in a new issue