summaryrefslogtreecommitdiffstats
path: root/runtime/base/arena_allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/base/arena_allocator.h')
-rw-r--r--runtime/base/arena_allocator.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/base/arena_allocator.h b/runtime/base/arena_allocator.h
index cc7b856..3a86b61 100644
--- a/runtime/base/arena_allocator.h
+++ b/runtime/base/arena_allocator.h
@@ -165,7 +165,7 @@ class MallocArena FINAL : public Arena {
class MemMapArena FINAL : public Arena {
public:
- explicit MemMapArena(size_t size = Arena::kDefaultSize);
+ explicit MemMapArena(size_t size, bool low_4gb);
virtual ~MemMapArena() { }
void Release() OVERRIDE;
@@ -175,7 +175,7 @@ class MemMapArena FINAL : public Arena {
class ArenaPool {
public:
- explicit ArenaPool(bool use_malloc = true);
+ explicit ArenaPool(bool use_malloc = true, bool low_4gb = false);
~ArenaPool();
Arena* AllocArena(size_t size) LOCKS_EXCLUDED(lock_);
void FreeArenaChain(Arena* first) LOCKS_EXCLUDED(lock_);
@@ -188,6 +188,7 @@ class ArenaPool {
const bool use_malloc_;
mutable Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
Arena* free_arenas_ GUARDED_BY(lock_);
+ const bool low_4gb_;
DISALLOW_COPY_AND_ASSIGN(ArenaPool);
};
@@ -227,6 +228,9 @@ class ArenaAllocator : private DebugStackRefCounter, private ArenaAllocatorStats
void ObtainNewArenaForAllocation(size_t allocation_size);
size_t BytesAllocated() const;
MemStats GetMemStats() const;
+ // The BytesUsed method sums up bytes allocated from arenas in arena_head_ and nodes.
+ // TODO: Change BytesAllocated to this behavior?
+ size_t BytesUsed() const;
private:
static constexpr size_t kAlignment = 8;