mirror of
https://github.com/boostorg/atomic.git
synced 2026-02-01 20:12:09 +00:00
c91cb67396e9d81dcb63f494dbc1fcaf62ed646f
The compiler, surprisingly, uses ebx for memory operands, which messed up the save/restore logic in asm blocks, resulting the memory operand (which was supposed to be the pointer to the atomic storage) being incorrect. First, clang (and, apparently, recent gcc as well) are able to deal with ebx around the asm blocks by themselves, which makes it unnecessary to save/restore the register in the asm blocks. Therefore, for those compilers we now use the non-PIC branch in PIC mode as well. This sidesteps the original problem with clang. Second, since we can't be sure if other compilers are able to pull the same trick, the PIC branches of code have been updated to avoid any memory operand constraints and use the explicitly calculated pointer in a register instead. We also no longer use a scratch slot on the stack to save ebx but instead use esi for that, which is also conveniently used for one of the inputs. This should be slightly faster as well. The downside is that we're possibly wasting one register for storing the pointer to the storage, but there seem to be no way around it.
Added Windows version specification to fix compilation with MSVC. The code targets for Windows 2000.
Boost.Atomic, part of collection of the Boost C++ Libraries, implements atomic operations for various CPU architectures, reflecting and extending the standard interface defined in C++11.
Directories
- build - Boost.Atomic build scripts
- doc - QuickBook documentation sources
- include - Interface headers of Boost.Atomic
- src - Compilable source code of Boost.Atomic
- test - Boost.Atomic unit tests
More information
- Documentation
- Report bugs. Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
- Submit your patches as pull requests against develop branch. Note that by submitting patches you agree to license your modifications under the Boost Software License, Version 1.0.
Build status
License
Distributed under the Boost Software License, Version 1.0.
Description
Languages
C++
99.3%
CMake
0.7%
