Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: src/allocation.cc

Issue 13932006: Replace OS::MemCopy with OS::MemMove (just as fast but more flexible). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/allocation.cc
diff --git a/src/allocation.cc b/src/allocation.cc
index 6c7a08cec8008b3f0675e25d7c422beb5ca20c15..94aaad3fd42e8aac7a99d19658b45bb95adbe0f0 100644
--- a/src/allocation.cc
+++ b/src/allocation.cc
@@ -28,8 +28,8 @@
#include "allocation.h"
#include <stdlib.h> // For free, malloc.
-#include <string.h> // For memcpy.
#include "checks.h"
+#include "platform.h"
#include "utils.h"
namespace v8 {
@@ -85,7 +85,7 @@ void AllStatic::operator delete(void* p) {
char* StrDup(const char* str) {
int length = StrLength(str);
char* result = NewArray<char>(length + 1);
- memcpy(result, str, length);
+ OS::MemCopy(result, str, length);
result[length] = '\0';
return result;
}
@@ -95,7 +95,7 @@ char* StrNDup(const char* str, int n) {
int length = StrLength(str);
if (n < length) length = n;
char* result = NewArray<char>(length + 1);
- memcpy(result, str, length);
+ OS::MemCopy(result, str, length);
result[length] = '\0';
return result;
}
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698