OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium 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 <dlfcn.h> | 5 #include <dlfcn.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <sys/mman.h> | 9 #include <sys/mman.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 #include <map> | 11 #include <map> |
12 | 12 |
13 #include "base/compiler_specific.h" | |
14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "tools/android/heap_profiler/heap_profiler.h" | 14 #include "tools/android/heap_profiler/heap_profiler.h" |
16 | 15 |
17 namespace { | 16 namespace { |
18 | 17 |
19 typedef void* (*AllocatorFn)(size_t); | 18 typedef void* (*AllocatorFn)(size_t); |
20 typedef int (*FreeFn)(void*, size_t); | 19 typedef int (*FreeFn)(void*, size_t); |
21 | 20 |
22 const size_t kSize1 = 499 * PAGE_SIZE; | 21 const size_t kSize1 = 499 * PAGE_SIZE; |
23 const size_t kSize2 = 503 * PAGE_SIZE; | 22 const size_t kSize2 = 503 * PAGE_SIZE; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 char* const env[] = {env_ld_preload, env_ld_lib_path, 0}; | 169 char* const env[] = {env_ld_preload, env_ld_lib_path, 0}; |
171 execve("/proc/self/exe", argv, env); | 170 execve("/proc/self/exe", argv, env); |
172 // execve() never returns, unless something goes wrong. | 171 // execve() never returns, unless something goes wrong. |
173 perror("execve"); | 172 perror("execve"); |
174 assert(false); | 173 assert(false); |
175 } | 174 } |
176 | 175 |
177 testing::InitGoogleTest(&argc, argv); | 176 testing::InitGoogleTest(&argc, argv); |
178 return RUN_ALL_TESTS(); | 177 return RUN_ALL_TESTS(); |
179 } | 178 } |
OLD | NEW |