3 ms·
I can't remember, has Apple bothered enabling thread-local storage in its clang distribution yet?
by cozzyd 9y ago
I can't remember, has Apple bothered enabling thread-local storage in its clang distribution yet?
- ComputerGuru 9y agoThe last time I checked, only for POC. In my uuid library [0], macOS is basically the only one I can’t create a per-thread rng and instead have to spin up a new one each time. 0: https://github.com/neosmart/uuidxx https://github.com/neosmart/uuidxx
- cozzyd 9y agoIt's frustrating, because TLS works fine on vanilla clang or newish gcc on Mac OS x.
- wahern 9y agoFWIW, macOS has arc4random(3) and arc4random_buf(3).
- ComputerGuru 9y agoThank you. It was supposed to be a platform-agnostic uuid library embracing the benefits of C++11 and beyond. But that was a pipe dream :)
- neilc 9y agoApple's clang supports thread_local as of XCode 8: https://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports/29929949#29929949 https://stackoverflow.com/questions/28094794/why-does-apple-...
- cozzyd 9y agoBetter late than never, I suppose. The answer indicates it might be ABI incompatible with upstream clang though? I'm sure that can cause a lot of fun...