 Chromium Code Reviews
 Chromium Code Reviews Issue 2344143003:
  Moved zones and zone related stuff in its own directory.  (Closed)
    
  
    Issue 2344143003:
  Moved zones and zone related stuff in its own directory.  (Closed) 
  | Index: src/zone/accounting-allocator.h | 
| diff --git a/src/base/accounting-allocator.h b/src/zone/accounting-allocator.h | 
| similarity index 59% | 
| rename from src/base/accounting-allocator.h | 
| rename to src/zone/accounting-allocator.h | 
| index 4e1baf18d4d57a37510f98ae4fa10d65a7c9f7ae..a38f953f20f101baf4e3a5e8fe8b213ebe904ecd 100644 | 
| --- a/src/base/accounting-allocator.h | 
| +++ b/src/zone/accounting-allocator.h | 
| @@ -5,32 +5,37 @@ | 
| #ifndef V8_BASE_ACCOUNTING_ALLOCATOR_H_ | 
| 
jochen (gone - plz use gerrit)
2016/09/16 13:14:52
please update this to V8_SRC_ZONE_ACCOUNTING...
 
heimbuef
2016/09/16 13:49:53
Done.
 | 
| #define V8_BASE_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_ |