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

Side by Side Diff: src/zone/accounting-allocator.h

Issue 2344143003: Moved zones and zone related stuff in its own directory. (Closed)
Patch Set: Merge branch 'master' into zonefolder Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/zone-containers.h ('k') | src/zone/accounting-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_ZONE_ACCOUNTING_ALLOCATOR_H_
6 #define V8_ZONE_ACCOUNTING_ALLOCATOR_H_
7
8 #include "include/v8-platform.h"
9 #include "src/base/atomic-utils.h"
10 #include "src/base/atomicops.h"
11 #include "src/base/macros.h"
12 #include "src/base/platform/mutex.h"
13 #include "src/base/platform/semaphore.h"
14 #include "src/base/platform/time.h"
15 #include "src/zone/zone-segment.h"
16
17 namespace v8 {
18 namespace internal {
19
20 class AccountingAllocator {
21 public:
22 AccountingAllocator() = default;
23 virtual ~AccountingAllocator() = default;
24
25 virtual Segment* AllocateSegment(size_t bytes);
26 virtual void FreeSegment(Segment* memory);
27
28 size_t GetCurrentMemoryUsage() const;
29 size_t GetMaxMemoryUsage() const;
30
31 private:
32 base::AtomicWord current_memory_usage_ = 0;
33 base::AtomicWord max_memory_usage_ = 0;
34
35 DISALLOW_COPY_AND_ASSIGN(AccountingAllocator);
36 };
37
38 } // namespace internal
39 } // namespace v8
40
41 #endif // V8_ZONE_ACCOUNTING_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « src/zone-containers.h ('k') | src/zone/accounting-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698