OLD | NEW |
1 // Copyright (c) 2007, Google Inc. | 1 // Copyright (c) 2007, 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 #if defined HAVE_STDINT_H | 36 #if defined HAVE_STDINT_H |
37 #include <stdint.h> // to get uintptr_t | 37 #include <stdint.h> // to get uintptr_t |
38 #elif defined HAVE_INTTYPES_H | 38 #elif defined HAVE_INTTYPES_H |
39 #include <inttypes.h> // another place uintptr_t might be defined | 39 #include <inttypes.h> // another place uintptr_t might be defined |
40 #endif | 40 #endif |
41 #include <sys/types.h> | 41 #include <sys/types.h> |
42 #include <algorithm> | 42 #include <algorithm> |
43 #include <limits> | 43 #include <limits> |
44 #include "base/logging.h" // for Check_GEImpl, Check_LTImpl, etc | 44 #include "base/logging.h" // for Check_GEImpl, Check_LTImpl, etc |
45 #include <google/malloc_extension.h> // for MallocExtension::instance | 45 #include <gperftools/malloc_extension.h> // for MallocExtension::instance |
46 #include "common.h" // for kAddressBits | 46 #include "common.h" // for kAddressBits |
47 | 47 |
48 class ArraySysAllocator : public SysAllocator { | 48 class ArraySysAllocator : public SysAllocator { |
49 public: | 49 public: |
50 // Was this allocator invoked at least once? | 50 // Was this allocator invoked at least once? |
51 bool invoked_; | 51 bool invoked_; |
52 | 52 |
53 ArraySysAllocator() : SysAllocator() { | 53 ArraySysAllocator() : SysAllocator() { |
54 ptr_ = 0; | 54 ptr_ = 0; |
55 invoked_ = false; | 55 invoked_ = false; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 delete [] q; | 145 delete [] q; |
146 } | 146 } |
147 | 147 |
148 int main(int argc, char** argv) { | 148 int main(int argc, char** argv) { |
149 TestBasicInvoked(); | 149 TestBasicInvoked(); |
150 TestBasicRetryFailTest(); | 150 TestBasicRetryFailTest(); |
151 | 151 |
152 printf("PASS\n"); | 152 printf("PASS\n"); |
153 return 0; | 153 return 0; |
154 } | 154 } |
OLD | NEW |