diff options
Diffstat (limited to 'compiler/utils/assembler.cc')
-rw-r--r-- | compiler/utils/assembler.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc index c2aa574f76..e6c3a18d04 100644 --- a/compiler/utils/assembler.cc +++ b/compiler/utils/assembler.cc @@ -47,7 +47,7 @@ namespace art { AssemblerBuffer::AssemblerBuffer(ArenaAllocator* arena) : arena_(arena) { static const size_t kInitialBufferCapacity = 4 * KB; - contents_ = arena_->AllocArray<uint8_t>(kInitialBufferCapacity); + contents_ = arena_->AllocArray<uint8_t>(kInitialBufferCapacity, kArenaAllocAssembler); cursor_ = contents_; limit_ = ComputeLimit(contents_, kInitialBufferCapacity); fixup_ = nullptr; @@ -94,6 +94,7 @@ void AssemblerBuffer::FinalizeInstructions(const MemoryRegion& instructions) { void AssemblerBuffer::ExtendCapacity(size_t min_capacity) { size_t old_size = Size(); size_t old_capacity = Capacity(); + DCHECK_GT(min_capacity, old_capacity); size_t new_capacity = std::min(old_capacity * 2, old_capacity + 1 * MB); new_capacity = std::max(new_capacity, min_capacity); |