| OLD | NEW |
| 1 // Copyright (c) 2009, Google Inc. | 1 // Copyright (c) 2009, 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 13 matching lines...) Expand all Loading... |
| 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 // --- | 30 // --- |
| 31 // Author: Andrew Fikes | 31 // Author: Andrew Fikes |
| 32 | 32 |
| 33 #include <config.h> | 33 #include <config.h> |
| 34 #include "base/spinlock.h" | |
| 35 #include "common.h" | |
| 36 #include "static_vars.h" | |
| 37 #include "stack_trace_table.h" | 34 #include "stack_trace_table.h" |
| 35 #include <string.h> // for NULL, memset |
| 36 #include "base/spinlock.h" // for SpinLockHolder |
| 37 #include "common.h" // for StackTrace |
| 38 #include "internal_logging.h" // for MESSAGE, ASSERT |
| 39 #include "page_heap_allocator.h" // for PageHeapAllocator |
| 40 #include "static_vars.h" // for Static |
| 38 | 41 |
| 39 namespace tcmalloc { | 42 namespace tcmalloc { |
| 40 | 43 |
| 41 bool StackTraceTable::Bucket::KeyEqual(uintptr_t h, | 44 bool StackTraceTable::Bucket::KeyEqual(uintptr_t h, |
| 42 const StackTrace& t) const { | 45 const StackTrace& t) const { |
| 43 const bool eq = (this->hash == h && this->trace.depth == t.depth); | 46 const bool eq = (this->hash == h && this->trace.depth == t.depth); |
| 44 for (int i = 0; eq && i < t.depth; ++i) { | 47 for (int i = 0; eq && i < t.depth; ++i) { |
| 45 if (this->trace.stack[i] != t.stack[i]) { | 48 if (this->trace.stack[i] != t.stack[i]) { |
| 46 return false; | 49 return false; |
| 47 } | 50 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 Static::bucket_allocator()->Delete(b); | 148 Static::bucket_allocator()->Delete(b); |
| 146 b = next; | 149 b = next; |
| 147 } | 150 } |
| 148 table_[i] = NULL; | 151 table_[i] = NULL; |
| 149 } | 152 } |
| 150 | 153 |
| 151 return out; | 154 return out; |
| 152 } | 155 } |
| 153 | 156 |
| 154 } // namespace tcmalloc | 157 } // namespace tcmalloc |
| OLD | NEW |