OLD | NEW |
1 // Copyright (c) 2011, Google Inc. | 1 // Copyright (c) 2011, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include <stdio.h> | 35 #include <stdio.h> |
36 #ifdef HAVE_MMAP | 36 #ifdef HAVE_MMAP |
37 #include <sys/mman.h> | 37 #include <sys/mman.h> |
38 #endif | 38 #endif |
39 #ifdef HAVE_UNISTD_H | 39 #ifdef HAVE_UNISTD_H |
40 #include <unistd.h> // for sleep() | 40 #include <unistd.h> // for sleep() |
41 #endif | 41 #endif |
42 #include <algorithm> | 42 #include <algorithm> |
43 #include <string> | 43 #include <string> |
44 #include <vector> | 44 #include <vector> |
45 #include <google/malloc_hook.h> | 45 #include <gperftools/malloc_hook.h> |
46 #include "malloc_hook-inl.h" | 46 #include "malloc_hook-inl.h" |
47 #include "base/logging.h" | 47 #include "base/logging.h" |
48 #include "base/simple_mutex.h" | 48 #include "base/simple_mutex.h" |
49 #include "base/sysinfo.h" | 49 #include "base/sysinfo.h" |
50 #include "tests/testutil.h" | 50 #include "tests/testutil.h" |
51 | 51 |
52 // On systems (like freebsd) that don't define MAP_ANONYMOUS, use the old | 52 // On systems (like freebsd) that don't define MAP_ANONYMOUS, use the old |
53 // form of the name instead. | 53 // form of the name instead. |
54 #ifndef MAP_ANONYMOUS | 54 #ifndef MAP_ANONYMOUS |
55 # define MAP_ANONYMOUS MAP_ANON | 55 # define MAP_ANONYMOUS MAP_ANON |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 // whoever owns that memory now. | 357 // whoever owns that memory now. |
358 // EXPECT_DEATH(*ptr = 'a', "SIGSEGV"); | 358 // EXPECT_DEATH(*ptr = 'a', "SIGSEGV"); |
359 } | 359 } |
360 #endif // #ifdef HAVE_MMAP && linux && ... | 360 #endif // #ifdef HAVE_MMAP && linux && ... |
361 | 361 |
362 } // namespace | 362 } // namespace |
363 | 363 |
364 int main(int argc, char** argv) { | 364 int main(int argc, char** argv) { |
365 return RUN_ALL_TESTS(); | 365 return RUN_ALL_TESTS(); |
366 } | 366 } |
OLD | NEW |