OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/allocation.h" | 5 #include "src/allocation.h" |
6 | 6 |
7 #include <stdlib.h> // For free, malloc. | 7 #include <stdlib.h> // For free, malloc. |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/base/logging.h" | 9 #include "src/base/logging.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 void* Embedded::operator new(size_t size) { | 39 void* Embedded::operator new(size_t size) { |
40 UNREACHABLE(); | 40 UNREACHABLE(); |
41 return invalid; | 41 return invalid; |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 void Embedded::operator delete(void* p) { | 45 void Embedded::operator delete(void* p) { |
46 UNREACHABLE(); | 46 UNREACHABLE(); |
47 } | 47 } |
48 | 48 |
49 | |
50 void* AllStatic::operator new(size_t size) { | |
51 UNREACHABLE(); | |
52 return invalid; | |
53 } | |
54 | |
55 | |
56 void AllStatic::operator delete(void* p) { | |
57 UNREACHABLE(); | |
58 } | |
59 | |
60 #endif | 49 #endif |
61 | 50 |
62 | 51 |
63 char* StrDup(const char* str) { | 52 char* StrDup(const char* str) { |
64 int length = StrLength(str); | 53 int length = StrLength(str); |
65 char* result = NewArray<char>(length + 1); | 54 char* result = NewArray<char>(length + 1); |
66 MemCopy(result, str, length); | 55 MemCopy(result, str, length); |
67 result[length] = '\0'; | 56 result[length] = '\0'; |
68 return result; | 57 return result; |
69 } | 58 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 #elif V8_LIBC_BIONIC | 92 #elif V8_LIBC_BIONIC |
104 // Using free is not correct in general, but for V8_LIBC_BIONIC it is. | 93 // Using free is not correct in general, but for V8_LIBC_BIONIC it is. |
105 free(ptr); | 94 free(ptr); |
106 #else | 95 #else |
107 free(ptr); | 96 free(ptr); |
108 #endif | 97 #endif |
109 } | 98 } |
110 | 99 |
111 } // namespace internal | 100 } // namespace internal |
112 } // namespace v8 | 101 } // namespace v8 |
OLD | NEW |