| Index: src/base/accounting-allocator.h
|
| diff --git a/src/base/accounting-allocator.h b/src/base/accounting-allocator.h
|
| index ce67f3790ef846a02f09b12101cfbf9fbcd29f59..1f26529b097af4fab2bc644f0f0be05f45b9b102 100644
|
| --- a/src/base/accounting-allocator.h
|
| +++ b/src/base/accounting-allocator.h
|
| @@ -5,6 +5,7 @@
|
| #ifndef V8_BASE_ACCOUNTING_ALLOCATOR_H_
|
| #define V8_BASE_ACCOUNTING_ALLOCATOR_H_
|
|
|
| +#include "src/base/platform/mutex.h"
|
| #include "src/base/atomicops.h"
|
| #include "src/base/macros.h"
|
|
|
| @@ -13,17 +14,20 @@ namespace base {
|
|
|
| class AccountingAllocator final {
|
| public:
|
| - AccountingAllocator() = default;
|
| - ~AccountingAllocator() = default;
|
| + AccountingAllocator() {}
|
| + ~AccountingAllocator() {}
|
|
|
| // Returns nullptr on failed allocation.
|
| void* Allocate(size_t bytes);
|
| void Free(void* memory, size_t bytes);
|
|
|
| size_t GetCurrentMemoryUsage() const;
|
| + size_t GetPeakMemoryUsage() const;
|
|
|
| private:
|
| - AtomicWord current_memory_usage_ = 0;
|
| + size_t current_memory_usage_ = 0;
|
| + size_t peak_memory_usage_ = 0;
|
| + Mutex mutex_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AccountingAllocator);
|
| };
|
|
|