Skip acquiring block-lock in BumpPointerSpace::AllocThreadUnsafe
Using it causes lock-level violation with JNI global reference table
lock. The purpose of the usage is anyways not too important.
Test: art/test/testrunner/run_build_test_target.py -j80 art-gtest-ss-gc
Bug: 160737021
Change-Id: I1042fdd1ffc9a6354ce8f628f0f5baec0d7cc0df
diff --git a/runtime/gc/space/bump_pointer_space-inl.h b/runtime/gc/space/bump_pointer_space-inl.h
index 41f2f7d..2774b9e 100644
--- a/runtime/gc/space/bump_pointer_space-inl.h
+++ b/runtime/gc/space/bump_pointer_space-inl.h
@@ -45,14 +45,6 @@
size_t* bytes_allocated,
size_t* usable_size,
size_t* bytes_tl_bulk_allocated) {
- {
- // We don't create blocks for these allocations. So confirm that we are still
- // operating on the main-block.
- // TODO: If the assertion fails, then start associating
- // each allocation here to a new block.
- MutexLock mu(self, block_lock_);
- CHECK(block_sizes_.empty());
- }
Locks::mutator_lock_->AssertExclusiveHeld(self);
num_bytes = RoundUp(num_bytes, kAlignment);
uint8_t* end = end_.load(std::memory_order_relaxed);
diff --git a/runtime/gc/space/bump_pointer_space.h b/runtime/gc/space/bump_pointer_space.h
index acea382..bba1711 100644
--- a/runtime/gc/space/bump_pointer_space.h
+++ b/runtime/gc/space/bump_pointer_space.h
@@ -59,7 +59,7 @@
// Thread-unsafe allocation for when mutators are suspended, used by the semispace collector.
mirror::Object* AllocThreadUnsafe(Thread* self, size_t num_bytes, size_t* bytes_allocated,
size_t* usable_size, size_t* bytes_tl_bulk_allocated)
- override REQUIRES(Locks::mutator_lock_, !block_lock_);
+ override REQUIRES(Locks::mutator_lock_);
mirror::Object* AllocNonvirtual(size_t num_bytes);
mirror::Object* AllocNonvirtualWithoutAccounting(size_t num_bytes);