| 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 | 5 |
| 6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
| 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
| 8 #define V8_SHARED | 8 #define V8_SHARED |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 #ifndef CHECK | 69 #ifndef CHECK |
| 70 #define CHECK(condition) assert(condition) | 70 #define CHECK(condition) assert(condition) |
| 71 #endif | 71 #endif |
| 72 | 72 |
| 73 namespace v8 { | 73 namespace v8 { |
| 74 | 74 |
| 75 namespace { | 75 namespace { |
| 76 | 76 |
| 77 const int MB = 1024 * 1024; | 77 const int MB = 1024 * 1024; |
| 78 #ifndef V8_SHARED |
| 78 const int kMaxWorkers = 50; | 79 const int kMaxWorkers = 50; |
| 80 #endif |
| 79 | 81 |
| 80 | 82 |
| 81 class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 83 class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 82 public: | 84 public: |
| 83 virtual void* Allocate(size_t length) { | 85 virtual void* Allocate(size_t length) { |
| 84 void* data = AllocateUninitialized(length); | 86 void* data = AllocateUninitialized(length); |
| 85 return data == NULL ? data : memset(data, 0, length); | 87 return data == NULL ? data : memset(data, 0, length); |
| 86 } | 88 } |
| 87 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } | 89 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } |
| 88 virtual void Free(void* data, size_t) { free(data); } | 90 virtual void Free(void* data, size_t) { free(data); } |
| (...skipping 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2483 } | 2485 } |
| 2484 | 2486 |
| 2485 } // namespace v8 | 2487 } // namespace v8 |
| 2486 | 2488 |
| 2487 | 2489 |
| 2488 #ifndef GOOGLE3 | 2490 #ifndef GOOGLE3 |
| 2489 int main(int argc, char* argv[]) { | 2491 int main(int argc, char* argv[]) { |
| 2490 return v8::Shell::Main(argc, argv); | 2492 return v8::Shell::Main(argc, argv); |
| 2491 } | 2493 } |
| 2492 #endif | 2494 #endif |
| OLD | NEW |