Ensure usable space data is zeroed in arrays.
Address other outstanding review comments.
Change-Id: Iaffe04de080772a0d0c5fd973bcac0e23c8c3e25
diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h
index ce9dcea..e089ef2 100644
--- a/runtime/gc/heap-inl.h
+++ b/runtime/gc/heap-inl.h
@@ -74,7 +74,7 @@
obj->AssertSelfBrooksPointer();
}
pre_fence_visitor(obj, usable_size);
- if (kIsDebugBuild && klass != nullptr && Runtime::Current()->IsStarted()) {
+ if (kIsDebugBuild && Runtime::Current()->IsStarted()) {
CHECK_LE(obj->SizeOf(), usable_size);
}
const size_t new_num_bytes_allocated =
diff --git a/runtime/gc/space/rosalloc_space.cc b/runtime/gc/space/rosalloc_space.cc
index 567ec99..fe8421d 100644
--- a/runtime/gc/space/rosalloc_space.cc
+++ b/runtime/gc/space/rosalloc_space.cc
@@ -45,9 +45,9 @@
}
RosAllocSpace* RosAllocSpace::CreateFromMemMap(MemMap* mem_map, const std::string& name,
- size_t starting_size, size_t initial_size,
- size_t growth_limit, size_t capacity,
- bool low_memory_mode) {
+ size_t starting_size, size_t initial_size,
+ size_t growth_limit, size_t capacity,
+ bool low_memory_mode) {
DCHECK(mem_map != nullptr);
allocator::RosAlloc* rosalloc = CreateRosAlloc(mem_map->Begin(), starting_size, initial_size,
low_memory_mode);
@@ -73,8 +73,8 @@
}
RosAllocSpace* RosAllocSpace::Create(const std::string& name, size_t initial_size,
- size_t growth_limit, size_t capacity, byte* requested_begin,
- bool low_memory_mode) {
+ size_t growth_limit, size_t capacity, byte* requested_begin,
+ bool low_memory_mode) {
uint64_t start_time = 0;
if (VLOG_IS_ON(heap) || VLOG_IS_ON(startup)) {
start_time = NanoTime();