OLD | NEW |
1 // Copyright 2009 Google Inc. All Rights Reserved. | 1 // Copyright 2009 Google Inc. All Rights Reserved. |
2 // Author: fikes@google.com (Andrew Fikes) | 2 // Author: fikes@google.com (Andrew Fikes) |
3 | 3 |
| 4 #include "config_for_unittests.h" |
| 5 #include "page_heap.h" |
4 #include <stdio.h> | 6 #include <stdio.h> |
5 #include "config_for_unittests.h" | |
6 #include "base/logging.h" | 7 #include "base/logging.h" |
7 #include "common.h" | 8 #include "common.h" |
8 #include "page_heap.h" | |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 static void CheckStats(const tcmalloc::PageHeap* ph, | 12 static void CheckStats(const tcmalloc::PageHeap* ph, |
13 uint64_t system_pages, | 13 uint64_t system_pages, |
14 uint64_t free_pages, | 14 uint64_t free_pages, |
15 uint64_t unmapped_pages) { | 15 uint64_t unmapped_pages) { |
16 tcmalloc::PageHeap::Stats stats = ph->stats(); | 16 tcmalloc::PageHeap::Stats stats = ph->stats(); |
17 EXPECT_EQ(system_pages, stats.system_bytes >> kPageShift); | 17 EXPECT_EQ(system_pages, stats.system_bytes >> kPageShift); |
18 EXPECT_EQ(free_pages, stats.free_bytes >> kPageShift); | 18 EXPECT_EQ(free_pages, stats.free_bytes >> kPageShift); |
(...skipping 27 matching lines...) Expand all Loading... |
46 delete ph; | 46 delete ph; |
47 } | 47 } |
48 | 48 |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 int main(int argc, char **argv) { | 51 int main(int argc, char **argv) { |
52 TestPageHeap_Stats(); | 52 TestPageHeap_Stats(); |
53 printf("PASS\n"); | 53 printf("PASS\n"); |
54 return 0; | 54 return 0; |
55 } | 55 } |
OLD | NEW |