Index: src/platform-posix.cc |
diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
index 8365352d64aff63329d5cd94b828ee452b957129..9cf8b57e178304096b42fa70f3d1fddd19db9569 100644 |
--- a/src/platform-posix.cc |
+++ b/src/platform-posix.cc |
@@ -217,8 +217,9 @@ void OS::MemCopy(void* dest, const void* src, size_t size) { |
ScopedLock lock(memcopy_function_mutex); |
Isolate::EnsureDefaultIsolate(); |
if (memcopy_function == NULL) { |
- Release_Store(reinterpret_cast<AtomicWord*>(&memcopy_function), |
- reinterpret_cast<AtomicWord>(CreateMemCopyFunction())); |
+ OS::MemCopyFunction temp = CreateMemCopyFunction(); |
+ MemoryBarrier(); |
+ memcopy_function = temp; |
} |
} |
(*memcopy_function)(dest, src, size); |