OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Tests of the TokenLock class from lock.h | 3 // Tests of the TokenLock class from lock.h |
4 | 4 |
5 #include <pthread.h> | 5 #include <pthread.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <unistd.h> // for usleep() | 7 #include <unistd.h> // for usleep() |
8 | 8 |
9 #include "v8.h" | 9 #include "v8.h" |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 CHECK(vm->IsReserved()); | 72 CHECK(vm->IsReserved()); |
73 void* block_addr = vm->address(); | 73 void* block_addr = vm->address(); |
74 size_t block_size = 4 * KB; | 74 size_t block_size = 4 * KB; |
75 CHECK(vm->Commit(block_addr, block_size, false)); | 75 CHECK(vm->Commit(block_addr, block_size, false)); |
76 // Check whether we can write to memory. | 76 // Check whether we can write to memory. |
77 int* addr = static_cast<int*>(block_addr); | 77 int* addr = static_cast<int*>(block_addr); |
78 addr[KB-1] = 2; | 78 addr[KB-1] = 2; |
79 CHECK(vm->Uncommit(block_addr, block_size)); | 79 CHECK(vm->Uncommit(block_addr, block_size)); |
80 delete vm; | 80 delete vm; |
81 } | 81 } |
| 82 |
| 83 TEST(GetCurrentProcessId) { |
| 84 OS::SetUp(); |
| 85 CHECK_EQ(static_cast<int>(getpid()), OS::GetCurrentProcessId()); |
| 86 } |
OLD | NEW |