Make allocations report usable size.
Work-in-progress to allow arrays to fill usable size. Bug: 13028925.
Use C++11's override keyword on GCC >= 2.7 to ensure that we override GC and
allocator methods.
Move initial mirror::Class set up into a Functor so that all allocated objects
have non-zero sizes. Use this property to assert that all objects are never
larger than their usable size.
Other bits of GC related clean-up, missing initialization, missing use of
const, hot methods in .cc files, "unimplemented" functions that fail at
runtime in header files, reducing header file includes, move valgrind's space
into its own files, reduce number of array allocation routines.
Change-Id: Id5760041a2d7f94dcaf17ec760f6095ec75dadaa
diff --git a/runtime/gc/space/bump_pointer_space.cc b/runtime/gc/space/bump_pointer_space.cc
index f3f594f..43674ea 100644
--- a/runtime/gc/space/bump_pointer_space.cc
+++ b/runtime/gc/space/bump_pointer_space.cc
@@ -58,19 +58,6 @@
num_blocks_(0) {
}
-mirror::Object* BumpPointerSpace::Alloc(Thread*, size_t num_bytes, size_t* bytes_allocated) {
- num_bytes = RoundUp(num_bytes, kAlignment);
- mirror::Object* ret = AllocNonvirtual(num_bytes);
- if (LIKELY(ret != nullptr)) {
- *bytes_allocated = num_bytes;
- }
- return ret;
-}
-
-size_t BumpPointerSpace::AllocationSize(mirror::Object* obj) {
- return AllocationSizeNonvirtual(obj);
-}
-
void BumpPointerSpace::Clear() {
// Release the pages back to the operating system.
CHECK_NE(madvise(Begin(), Limit() - Begin(), MADV_DONTNEED), -1) << "madvise failed";
@@ -185,8 +172,9 @@
}
}
-bool BumpPointerSpace::IsEmpty() const {
- return Begin() == End();
+accounting::SpaceBitmap::SweepCallback* BumpPointerSpace::GetSweepCallback() {
+ LOG(FATAL) << "Unimplemented";
+ return nullptr;
}
uint64_t BumpPointerSpace::GetBytesAllocated() {