Fix timing logger sometimes not adding a split due to 0 byte freed Gc
SweepArray didnt add FreeList if we freed 0 objects, this was an unlikely case.
This caused things to not line up in the cumulative timing logger.
Change-Id: I03b6f23a807898c29cf85d69eefc74ee5e6cda46
diff --git a/src/mark_sweep.cc b/src/mark_sweep.cc
index c21c19c..12e0e47 100644
--- a/src/mark_sweep.cc
+++ b/src/mark_sweep.cc
@@ -503,15 +503,13 @@
logger.AddSplit("Process allocation stack");
size_t freed_objects = out - objects;
- if (freed_objects != 0) {
- VLOG(heap) << "Freed " << freed_objects << "/" << count
- << " objects with size " << PrettySize(freed_bytes);
- space->FreeList(freed_objects, objects);
- heap_->RecordFree(freed_objects, freed_bytes);
- freed_objects_ += freed_objects;
- freed_bytes_ += freed_bytes;
- logger.AddSplit("FreeList");
- }
+ VLOG(heap) << "Freed " << freed_objects << "/" << count
+ << " objects with size " << PrettySize(freed_bytes);
+ space->FreeList(freed_objects, objects);
+ heap_->RecordFree(freed_objects, freed_bytes);
+ freed_objects_ += freed_objects;
+ freed_bytes_ += freed_bytes;
+ logger.AddSplit("FreeList");
allocations->Reset();
logger.AddSplit("Reset stack");