Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: tools/memory_watcher/call_stack.h

Issue 345033: Improve memwatch tool.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/memory_watcher/memory_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/memory_watcher/call_stack.h
===================================================================
--- tools/memory_watcher/call_stack.h (revision 30121)
+++ tools/memory_watcher/call_stack.h (working copy)
@@ -15,6 +15,7 @@
#include <dbghelp.h>
#include <functional>
#include <map>
+#include <string>
#include "memory_watcher.h"
#include "base/lock.h"
@@ -81,28 +82,19 @@
DISALLOW_EVIL_CONSTRUCTORS(CallStack);
};
-// An AllocationStack is a type of CallStack which represents
-// a CallStack where memory has been allocated. As such, in
-// addition to the CallStack information, it also tracks the
-// amount of memory allocated.
+// An AllocationStack is a type of CallStack which represents a CallStack where
+// memory has been allocated. This class is also a list item, so that it can
+// be easilly allocated and deallocated from its static singly-linked-list of
+// free instances.
class AllocationStack : public CallStack {
public:
- explicit AllocationStack(int32 alloc_size)
- : allocation_size_(alloc_size),
- next_(NULL),
- CallStack() {
- }
+ AllocationStack() : next_(NULL), CallStack() {}
- // The size of the allocation.
- int32 allocation_size() { return allocation_size_; }
-
// We maintain a freelist of the AllocationStacks.
void* operator new(size_t s);
void operator delete(void*p);
private:
- int32 allocation_size_; // The size of the allocation
-
AllocationStack* next_; // Pointer used when on the freelist.
static AllocationStack* freelist_;
static Lock freelist_lock_;
« no previous file with comments | « no previous file | tools/memory_watcher/memory_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698