Revoke rosalloc thread-local buffers at the checkpoint.

In the mark sweep collector, rosalloc thread-local buffers were
revoked during the pause. Now, they are revoked at the thread
checkpoint, as opposed to during the pause, which appears to help
reduce the pause time.

In Ritz MemAllocTest, the average sticky pause time went down ~20%
(925 us -> 724 us).

Bug: 13394464
Bug: 9986565
Change-Id: I104992a11b46d59264c0b9aa2db82b1ccf2826bc
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 2bab000..8d06673 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2228,6 +2228,14 @@
   }
 }
 
+void Heap::AssertAllBumpPointerSpaceThreadLocalBuffersAreRevoked() {
+  if (kIsDebugBuild) {
+    if (bump_pointer_space_ != nullptr) {
+      bump_pointer_space_->AssertAllThreadLocalBuffersAreRevoked();
+    }
+  }
+}
+
 accounting::ModUnionTable* Heap::FindModUnionTableFromSpace(space::Space* space) {
   auto it = mod_union_tables_.find(space);
   if (it == mod_union_tables_.end()) {
@@ -2650,6 +2658,12 @@
   }
 }
 
+void Heap::RevokeRosAllocThreadLocalBuffers(Thread* thread) {
+  if (rosalloc_space_ != nullptr) {
+    rosalloc_space_->RevokeThreadLocalBuffers(thread);
+  }
+}
+
 void Heap::RevokeAllThreadLocalBuffers() {
   if (rosalloc_space_ != nullptr) {
     rosalloc_space_->RevokeAllThreadLocalBuffers();