| Index: third_party/tcmalloc/chromium/src/heap-profile-stats.h
|
| diff --git a/third_party/tcmalloc/chromium/src/heap-profile-stats.h b/third_party/tcmalloc/chromium/src/heap-profile-stats.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3209bb752071aebb5a7ad6803481d0bcb43d6bfa
|
| --- /dev/null
|
| +++ b/third_party/tcmalloc/chromium/src/heap-profile-stats.h
|
| @@ -0,0 +1,34 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef HEAP_PROFILE_STATS_H_
|
| +#define HEAP_PROFILE_STATS_H_
|
| +
|
| +class HeapProfileStats {
|
| +public:
|
| + // Longest stack trace we record.
|
| + static const int kMaxStackDepth = 32;
|
| +
|
| + struct Stats {
|
| + int32 allocs; // Number of allocation calls
|
| + int32 frees; // Number of free calls
|
| + int64 alloc_size; // Total size of all allocated objects so far
|
| + int64 free_size; // Total size of all freed objects so far
|
| +
|
| + // semantic equality
|
| + bool Equivalent(const Stats& x) const {
|
| + return allocs - frees == x.allocs - x.frees &&
|
| + alloc_size - free_size == x.alloc_size - x.free_size;
|
| + }
|
| + };
|
| +
|
| + struct Bucket : public Stats {
|
| + uintptr_t hash; // Hash value of the stack trace
|
| + int depth; // Depth of stack trace
|
| + const void** stack; // Stack trace
|
| + Bucket* next; // Next entry in hash-table
|
| + };
|
| +};
|
| +
|
| +#endif // HEAP_PROFILE_STATS_H_
|
|
|