summaryrefslogtreecommitdiffstats
path: root/compiler/utils
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-08-20 15:08:45 -0700
committerIan Rogers <irogers@google.com>2014-08-20 15:09:20 -0700
commite77493c7217efdd1a0ecef521a6845a13da0305b (patch)
tree3055cb7aaea8b9edc498b2e209d74af36c32e0fd /compiler/utils
parent41cba7c66cbc441b00fca48dfb2501181b1f2a53 (diff)
downloadart-e77493c7217efdd1a0ecef521a6845a13da0305b.zip
art-e77493c7217efdd1a0ecef521a6845a13da0305b.tar.gz
art-e77493c7217efdd1a0ecef521a6845a13da0305b.tar.bz2
Make common BitVector operations inline-able.
Change-Id: Ie25de4fae56c6712539f04172c42e3eff57df7ca
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/arena_bit_vector.cc5
-rw-r--r--compiler/utils/arena_bit_vector.h20
2 files changed, 13 insertions, 12 deletions
diff --git a/compiler/utils/arena_bit_vector.cc b/compiler/utils/arena_bit_vector.cc
index 39f7d18..de35f3d 100644
--- a/compiler/utils/arena_bit_vector.cc
+++ b/compiler/utils/arena_bit_vector.cc
@@ -16,11 +16,12 @@
#include "arena_allocator.h"
#include "arena_bit_vector.h"
+#include "base/allocator.h"
namespace art {
template <typename ArenaAlloc>
-class ArenaBitVectorAllocator : public Allocator {
+class ArenaBitVectorAllocator FINAL : public Allocator {
public:
explicit ArenaBitVectorAllocator(ArenaAlloc* arena) : arena_(arena) {}
~ArenaBitVectorAllocator() {}
@@ -37,7 +38,7 @@ class ArenaBitVectorAllocator : public Allocator {
static void operator delete(void* p) {} // Nop.
private:
- ArenaAlloc* arena_;
+ ArenaAlloc* const arena_;
DISALLOW_COPY_AND_ASSIGN(ArenaBitVectorAllocator);
};
diff --git a/compiler/utils/arena_bit_vector.h b/compiler/utils/arena_bit_vector.h
index 485ed76..c92658f 100644
--- a/compiler/utils/arena_bit_vector.h
+++ b/compiler/utils/arena_bit_vector.h
@@ -51,23 +51,23 @@ std::ostream& operator<<(std::ostream& os, const OatBitMapKind& kind);
* A BitVector implementation that uses Arena allocation.
*/
class ArenaBitVector : public BitVector {
- public:
- ArenaBitVector(ArenaAllocator* arena, uint32_t start_bits, bool expandable,
- OatBitMapKind kind = kBitMapMisc);
- ArenaBitVector(ScopedArenaAllocator* arena, uint32_t start_bits, bool expandable,
- OatBitMapKind kind = kBitMapMisc);
- ~ArenaBitVector() {}
+ public:
+ ArenaBitVector(ArenaAllocator* arena, uint32_t start_bits, bool expandable,
+ OatBitMapKind kind = kBitMapMisc);
+ ArenaBitVector(ScopedArenaAllocator* arena, uint32_t start_bits, bool expandable,
+ OatBitMapKind kind = kBitMapMisc);
+ ~ArenaBitVector() {}
static void* operator new(size_t size, ArenaAllocator* arena) {
- return arena->Alloc(sizeof(ArenaBitVector), kArenaAllocGrowableBitMap);
+ return arena->Alloc(sizeof(ArenaBitVector), kArenaAllocGrowableBitMap);
}
static void* operator new(size_t size, ScopedArenaAllocator* arena) {
- return arena->Alloc(sizeof(ArenaBitVector), kArenaAllocGrowableBitMap);
+ return arena->Alloc(sizeof(ArenaBitVector), kArenaAllocGrowableBitMap);
}
static void operator delete(void* p) {} // Nop.
- private:
- const OatBitMapKind kind_; // for memory use tuning. TODO: currently unused.
+ private:
+ const OatBitMapKind kind_; // for memory use tuning. TODO: currently unused.
};