| Index: src/allocation.cc
|
| ===================================================================
|
| --- src/allocation.cc (revision 5846)
|
| +++ src/allocation.cc (working copy)
|
| @@ -27,16 +27,21 @@
|
|
|
| #include <stdlib.h>
|
|
|
| -#include "v8.h"
|
| +#include "../include/v8stdint.h"
|
| +#include "globals.h"
|
| +#include "checks.h"
|
| +#include "allocation.h"
|
| +#include "utils.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
|
|
| -
|
| void* Malloced::New(size_t size) {
|
| ASSERT(NativeAllocationChecker::allocation_allowed());
|
| void* result = malloc(size);
|
| - if (result == NULL) V8::FatalProcessOutOfMemory("Malloced operator new");
|
| + if (result == NULL) {
|
| + v8::internal::FatalProcessOutOfMemory("Malloced operator new");
|
| + }
|
| return result;
|
| }
|
|
|
| @@ -47,7 +52,7 @@
|
|
|
|
|
| void Malloced::FatalProcessOutOfMemory() {
|
| - V8::FatalProcessOutOfMemory("Out of memory");
|
| + v8::internal::FatalProcessOutOfMemory("Out of memory");
|
| }
|
|
|
|
|
| @@ -82,7 +87,7 @@
|
| char* StrDup(const char* str) {
|
| int length = StrLength(str);
|
| char* result = NewArray<char>(length + 1);
|
| - memcpy(result, str, length * kCharSize);
|
| + memcpy(result, str, length);
|
| result[length] = '\0';
|
| return result;
|
| }
|
| @@ -92,7 +97,7 @@
|
| int length = StrLength(str);
|
| if (n < length) length = n;
|
| char* result = NewArray<char>(length + 1);
|
| - memcpy(result, str, length * kCharSize);
|
| + memcpy(result, str, length);
|
| result[length] = '\0';
|
| return result;
|
| }
|
| @@ -124,6 +129,7 @@
|
| }
|
| ASSERT(free_list_.next_ != &free_list_);
|
| ASSERT(free_list_.previous_ != &free_list_);
|
| +
|
| size = (size + kPointerSize - 1) & ~(kPointerSize - 1);
|
| // Search for exact fit.
|
| for (PreallocatedStorage* storage = free_list_.next_;
|
|
|