Fix brick table issue on Unix
authorJan Vorlicek <janvorli@microsoft.com>
Mon, 11 Apr 2016 11:42:07 +0000 (13:42 +0200)
committerJan Vorlicek <janvorli@microsoft.com>
Mon, 11 Apr 2016 11:42:07 +0000 (13:42 +0200)
commit88547f5c813555b0556731889897370051e4fcf5
tree0e4f2adcbf6da0880d3896512bc8815cd3c1caeb
parente24fe5f26dcad22680fb16a3b67e756d34a54cee
Fix brick table issue on Unix

There is a problem with Clang compiling a loop that sets a range of brick
table entries that are "shorts" as a memset. That causes it to be written
by bytes in some cases on OSX (and it is a mere chance that the memset on
Linux is implemented so that it doesn't use byte access).
This was causing corruption of the brick table on OSX.
The fix is to mark the pointer that iterates over the brick table as volatile
to prevent the compiler from using the memset.

Commit migrated from https://github.com/dotnet/coreclr/commit/54e626fec535ce9eb1f97420c619572911eed583
src/coreclr/src/gc/gc.cpp