diff options
-rw-r--r-- | oatdump/oatdump.cc | 4 | ||||
-rw-r--r-- | runtime/gc/heap.h | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index 53b07f9..2a0d826 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -808,6 +808,10 @@ class ImageDumper { { WriterMutexLock mu(self, *Locks::heap_bitmap_lock_); heap->FlushAllocStack(); + // Since FlushAllocStack() above resets the (active) allocation + // stack. Need to revoke the thread-local allocation stacks that + // point into it. + heap->RevokeAllThreadLocalAllocationStacks(self); } { std::ostream* saved_os = os_; diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index 80a5a1a..49fc97a 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -474,6 +474,9 @@ class Heap { void FlushAllocStack() EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_); + // Revoke all the thread-local allocation stacks. + void RevokeAllThreadLocalAllocationStacks(Thread* self); + // Mark all the objects in the allocation stack in the specified bitmap. void MarkAllocStack(accounting::SpaceBitmap* bitmap1, accounting::SpaceBitmap* bitmap2, accounting::ObjectSet* large_objects, accounting::ObjectStack* stack) @@ -670,9 +673,6 @@ class Heap { // Swap the allocation stack with the live stack. void SwapStacks(Thread* self); - // Revoke all the thread-local allocation stacks. - void RevokeAllThreadLocalAllocationStacks(Thread* self); - // Clear cards and update the mod union table. void ProcessCards(TimingLogger& timings); |