| 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 <errno.h> | 5 #include <errno.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 if (RoundToPageSize(&length)) return VirtualMemoryAllocate(length); | 128 if (RoundToPageSize(&length)) return VirtualMemoryAllocate(length); |
| 129 #endif | 129 #endif |
| 130 // Work around for GCC bug on AIX | 130 // Work around for GCC bug on AIX |
| 131 // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79839 | 131 // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79839 |
| 132 #if V8_OS_AIX && _LINUX_SOURCE_COMPAT | 132 #if V8_OS_AIX && _LINUX_SOURCE_COMPAT |
| 133 return __linux_malloc(length); | 133 return __linux_malloc(length); |
| 134 #else | 134 #else |
| 135 return malloc(length); | 135 return malloc(length); |
| 136 #endif | 136 #endif |
| 137 } | 137 } |
| 138 using ArrayBufferAllocatorBase::Free; |
| 138 void Free(void* data, size_t length) override { | 139 void Free(void* data, size_t length) override { |
| 139 #if USE_VM | 140 #if USE_VM |
| 140 if (RoundToPageSize(&length)) { | 141 if (RoundToPageSize(&length)) { |
| 141 base::VirtualMemory::ReleaseRegion(data, length); | 142 base::VirtualMemory::ReleaseRegion(data, length); |
| 142 return; | 143 return; |
| 143 } | 144 } |
| 144 #endif | 145 #endif |
| 145 free(data); | 146 free(data); |
| 146 } | 147 } |
| 147 // If {length} is at least {VM_THRESHOLD}, round up to next page size | 148 // If {length} is at least {VM_THRESHOLD}, round up to next page size |
| (...skipping 3063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3211 } | 3212 } |
| 3212 | 3213 |
| 3213 } // namespace v8 | 3214 } // namespace v8 |
| 3214 | 3215 |
| 3215 | 3216 |
| 3216 #ifndef GOOGLE3 | 3217 #ifndef GOOGLE3 |
| 3217 int main(int argc, char* argv[]) { | 3218 int main(int argc, char* argv[]) { |
| 3218 return v8::Shell::Main(argc, argv); | 3219 return v8::Shell::Main(argc, argv); |
| 3219 } | 3220 } |
| 3220 #endif | 3221 #endif |
| OLD | NEW |