summaryrefslogtreecommitdiff
path: root/src/gc
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-04-11 13:42:07 +0200
committerJan Vorlicek <janvorli@microsoft.com>2016-04-11 13:42:07 +0200
commit54e626fec535ce9eb1f97420c619572911eed583 (patch)
treeddbeb98b8751e9063614e477e4b0328b671608c1 /src/gc
parente8c82e2c4363b58b76c036ba6db5a192f4e3d33b (diff)
downloadcoreclr-54e626fec535ce9eb1f97420c619572911eed583.tar.gz
coreclr-54e626fec535ce9eb1f97420c619572911eed583.tar.bz2
coreclr-54e626fec535ce9eb1f97420c619572911eed583.zip
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.
Diffstat (limited to 'src/gc')
-rw-r--r--src/gc/gc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index d039947518..3147a58072 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -11177,7 +11177,7 @@ void gc_heap::adjust_limit_clr (uint8_t* start, size_t limit_size,
b++;
dprintf (3, ("Allocation Clearing bricks [%Ix, %Ix[",
b, brick_of (align_on_brick (start + limit_size))));
- short* x = &brick_table [b];
+ volatile short* x = &brick_table [b];
short* end_x = &brick_table [brick_of (align_on_brick (start + limit_size))];
for (;x < end_x;x++)