Quantcast
Channel: Why is the compiler dedicating a memory location for storing a redundant variable in this case? - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by user4442671 for Why is the compiler dedicating a memory location...

Is there any specific reason to store that variable in stack rather than in registers?At the end of the day, atomics exist for inter-thread communication, and you can't share a register across...

View Article



Why is the compiler dedicating a memory location for storing a redundant...

I wrote this simple C++ code, to see how atomic variables are implemented.#include <atomic>using namespace std;atomic<float> f(0);int main() { f += 1.0;}It is generating this assembly for...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images