Hi, my app suddenly crashed inside the QBasicAtomicInt::ref() function. I see it's because of some foolishly uninitialized pointers, so I should be able to remedy the situation shortly. So what happened and how to debug it is out of question. Rather, I'm baffled by the function itself:
Qt Code:
  1. inline bool QBasicAtomicInt::ref()
  2. {
  3. unsigned char ret;
  4. asm volatile("lock\n"
  5. "incl %0\n"
  6. "setne %1"
  7. : "=m" (_q_value), "=qm" (ret)
  8. : "m" (_q_value)
  9. : "memory");
  10. return ret != 0;
  11. }
To copy to clipboard, switch view to plain text mode 
What is it supposed to do? How does it do it? How does asm keyword combine with volatile? Why are asm commands quoted? What are the colons ( : ) doing here? What could '"m" (_q_value)' possibly mean? Please, someone, explain the magic to me