Add some more DISALLOW_COPY_AND_ASSIGN
May help prevent bugs maybe.
Change-Id: Ie73d469dfcd078492ecb3aa28682b42707221202
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index a4353f6..90249f9 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -1201,41 +1201,23 @@
friend class VerifyReferenceVisitor;
friend class VerifyObjectVisitor;
friend class ScopedHeapFill;
- friend class ScopedHeapLock;
friend class space::SpaceTest;
class AllocationTimer {
- private:
- Heap* heap_;
- mirror::Object** allocated_obj_ptr_;
- uint64_t allocation_start_time_;
public:
- AllocationTimer(Heap* heap, mirror::Object** allocated_obj_ptr);
- ~AllocationTimer();
+ ALWAYS_INLINE AllocationTimer(Heap* heap, mirror::Object** allocated_obj_ptr);
+ ALWAYS_INLINE ~AllocationTimer();
+ private:
+ Heap* const heap_;
+ mirror::Object** allocated_obj_ptr_;
+ const uint64_t allocation_start_time_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationTimer);
};
DISALLOW_IMPLICIT_CONSTRUCTORS(Heap);
};
-// ScopedHeapFill changes the bytes allocated counter to be equal to the growth limit. This
-// causes the next allocation to perform a GC and possibly an OOM. It can be used to ensure that a
-// GC happens in specific methods such as ThrowIllegalMonitorStateExceptionF in Monitor::Wait.
-class ScopedHeapFill {
- public:
- explicit ScopedHeapFill(Heap* heap)
- : heap_(heap),
- delta_(heap_->GetMaxMemory() - heap_->GetBytesAllocated()) {
- heap_->num_bytes_allocated_.FetchAndAddSequentiallyConsistent(delta_);
- }
- ~ScopedHeapFill() {
- heap_->num_bytes_allocated_.FetchAndSubSequentiallyConsistent(delta_);
- }
-
- private:
- Heap* const heap_;
- const int64_t delta_;
-};
-
} // namespace gc
} // namespace art