Chromium Code Reviews| Index: src/zone/accounting-allocator.h | 
| diff --git a/src/base/accounting-allocator.h b/src/zone/accounting-allocator.h | 
| similarity index 51% | 
| rename from src/base/accounting-allocator.h | 
| rename to src/zone/accounting-allocator.h | 
| index 4e1baf18d4d57a37510f98ae4fa10d65a7c9f7ae..8a487d111f00b54b600ff805dedaf25cc76e7a6e 100644 | 
| --- a/src/base/accounting-allocator.h | 
| +++ b/src/zone/accounting-allocator.h | 
| @@ -2,35 +2,40 @@ | 
| // Use of this source code is governed by a BSD-style license that can be | 
| // found in the LICENSE file. | 
| -#ifndef V8_BASE_ACCOUNTING_ALLOCATOR_H_ | 
| -#define V8_BASE_ACCOUNTING_ALLOCATOR_H_ | 
| +#ifndef V8_SRC_ZONE_ACCOUNTING_ALLOCATOR_H_ | 
| 
 
marja
2016/09/19 08:05:11
Style: no SRC here
 
heimbuef
2016/09/19 10:47:51
Done.
 
heimbuef
2016/09/19 10:47:51
Done.
 
 | 
| +#define V8_SRC_ZONE_ACCOUNTING_ALLOCATOR_H_ | 
| +#include "include/v8-platform.h" | 
| +#include "src/base/atomic-utils.h" | 
| #include "src/base/atomicops.h" | 
| #include "src/base/macros.h" | 
| +#include "src/base/platform/mutex.h" | 
| +#include "src/base/platform/semaphore.h" | 
| +#include "src/base/platform/time.h" | 
| +#include "src/zone/zone-segment.h" | 
| namespace v8 { | 
| -namespace base { | 
| +namespace internal { | 
| class AccountingAllocator { | 
| public: | 
| AccountingAllocator() = default; | 
| virtual ~AccountingAllocator() = default; | 
| - // Returns nullptr on failed allocation. | 
| - virtual void* Allocate(size_t bytes); | 
| - virtual void Free(void* memory, size_t bytes); | 
| + virtual Segment* AllocateSegment(size_t bytes); | 
| + virtual void FreeSegment(Segment* memory); | 
| size_t GetCurrentMemoryUsage() const; | 
| size_t GetMaxMemoryUsage() const; | 
| private: | 
| - AtomicWord current_memory_usage_ = 0; | 
| - AtomicWord max_memory_usage_ = 0; | 
| + base::AtomicWord current_memory_usage_ = 0; | 
| + base::AtomicWord max_memory_usage_ = 0; | 
| DISALLOW_COPY_AND_ASSIGN(AccountingAllocator); | 
| }; | 
| -} // namespace base | 
| +} // namespace internal | 
| } // namespace v8 | 
| #endif // V8_BASE_ACCOUNTING_ALLOCATOR_H_ | 
| 
 
marja
2016/09/19 08:05:11
You need to update these comments too
 
 |