What steps will reproduce the problem?
1. compile for osx
What is the expected output? What do you see instead?
Native memory barriers are expected, gcc-style are used instead.
What version of the product are you using? On what operating system?
1.13. OSX (all versions)
Please provide any additional information below.
I'm unsure if there is any significance, but I noticed it while debugging
another issue.
During atomics selection, OSX falls into the (ARCH_CPU_X86_FAMILY) &&
defined(__GNUC__) condition before it can reach the elif defined(OS_MACOSX)
condition.
This means that Darwin's OSMemoryBarrier() is never used for x86.
In the upstream version, APPLE is searched first, presumably for the above
reason:
https://code.google.com/p/gperftools/source/browse/src/base/atomicops.h#102
This is easily tested by adding some garbage in the "(ARCH_CPU_X86_FAMILY) &&
defined(__GNUC__)" condition and noting the compile failure.
Reversing the order here ensures that OSMemoryBarrier() is used instead.
See attached patch.
Original issue reported on code.google.com by c...@atlastechnologiesinc.com on 28 Nov 2013 at 4:26
Original issue reported on code.google.com by
c...@atlastechnologiesinc.com
on 28 Nov 2013 at 4:26Attachments: