mozilla/rust — pull request #10258 by toffaletti (2013-11-04 07:26:07+00:00)
Title: Attempt at fixing mpmc_bounded_queue on 32bit where integer overflow is a concern.

I'm not super happy with this, I think I've probably missed some edge case and the logic is not at all straight forward. Maybe I should put the overflow logic into its own 'else if' and heavily comment it? Suggestions welcome.

P.S. - I couldn't actually compile this code because master doesn't build for me for some reason. I get:
```
error: linking with `cc` failed with code 1
note: cc arguments: -L/home/jason/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -m64 -o x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustdoc-a437806a76c5f37a-0.9-pre.so x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/lib.o -L/home/jason/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -lstd-6c65cf4b443341b1-0.9-pre -L/home/jason/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -lextra-a7c050cfd46b2c9a-0.9-pre -L/home/jason/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -lsyntax-64629f7f0c6a9bc-0.9-pre -L/home/jason/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -lrustc-d3cb8c2ccd84a7a7-0.9-pre -lsundown -Lx86_64-unknown-linux-gnu/rt/sundown -L/home/jason/rust/.rust -L/home/jason/rust -shared -lrt -ldl -lm -lmorestack -lrustrt -Wl,-rpath,$ORIGIN/. -Wl,-rpath,/home/jason/rust/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -Wl,-rpath,/usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib
note: cc: error: x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/lib.o: No such file or directory

error: aborting due to previous error
```
I've tried `make clean` and `./configure` again as well as `rm -rf tmp x86_64-unknown-linux-gnu`.