Index: src/regexp-stack.cc |
diff --git a/src/regexp-stack.cc b/src/regexp-stack.cc |
index 325a1496c98c9a26d05c9fffc1c97be132e401f0..fc4114af5de202d49507b9be3a1902c43b3d1881 100644 |
--- a/src/regexp-stack.cc |
+++ b/src/regexp-stack.cc |
@@ -57,9 +57,7 @@ RegExpStack::~RegExpStack() { |
char* RegExpStack::ArchiveStack(char* to) { |
size_t size = sizeof(thread_local_); |
- memcpy(reinterpret_cast<void*>(to), |
- &thread_local_, |
- size); |
+ OS::MemCopy(reinterpret_cast<void*>(to), &thread_local_, size); |
thread_local_ = ThreadLocal(); |
return to + size; |
} |
@@ -67,7 +65,7 @@ char* RegExpStack::ArchiveStack(char* to) { |
char* RegExpStack::RestoreStack(char* from) { |
size_t size = sizeof(thread_local_); |
- memcpy(&thread_local_, reinterpret_cast<void*>(from), size); |
+ OS::MemCopy(&thread_local_, reinterpret_cast<void*>(from), size); |
return from + size; |
} |
@@ -95,10 +93,11 @@ Address RegExpStack::EnsureCapacity(size_t size) { |
Address new_memory = NewArray<byte>(static_cast<int>(size)); |
if (thread_local_.memory_size_ > 0) { |
// Copy original memory into top of new memory. |
- memcpy(reinterpret_cast<void*>( |
- new_memory + size - thread_local_.memory_size_), |
- reinterpret_cast<void*>(thread_local_.memory_), |
- thread_local_.memory_size_); |
+ OS::MemCopy( |
+ reinterpret_cast<void*>( |
+ new_memory + size - thread_local_.memory_size_), |
+ reinterpret_cast<void*>(thread_local_.memory_), |
+ thread_local_.memory_size_); |
DeleteArray(thread_local_.memory_); |
} |
thread_local_.memory_ = new_memory; |