heap_state.contexts_disposed = 1;
heap_state.incremental_marking_stopped = true;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
- int idle_time_ms = (heap_state.size_of_objects + speed - 1) / speed;
+ int idle_time_ms =
+ static_cast<int>((heap_state.size_of_objects + speed - 1) / speed);
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_FULL_GC, action.type);
}
heap_state.contexts_disposed = 1;
heap_state.incremental_marking_stopped = true;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
- int idle_time_ms = heap_state.size_of_objects / speed - 1;
+ int idle_time_ms = static_cast<int>(heap_state.size_of_objects / speed - 1);
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_INCREMENTAL_MARKING, action.type);
}
GCIdleTimeHandler::HeapState heap_state = DefaultHeapState();
heap_state.contexts_disposed = 1;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
- int idle_time_ms = heap_state.size_of_objects / speed - 1;
+ int idle_time_ms = static_cast<int>(heap_state.size_of_objects / speed - 1);
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_INCREMENTAL_MARKING, action.type);
}
heap_state.incremental_marking_stopped = true;
heap_state.can_start_incremental_marking = false;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
- int idle_time_ms = heap_state.size_of_objects / speed - 1;
+ int idle_time_ms = static_cast<int>(heap_state.size_of_objects / speed - 1);
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_NOTHING, action.type);
}
heap_state.incremental_marking_stopped = true;
heap_state.can_start_incremental_marking = false;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
- int idle_time_ms = heap_state.size_of_objects / speed + 1;
+ int idle_time_ms = static_cast<int>(heap_state.size_of_objects / speed + 1);
for (int i = 0; i < GCIdleTimeHandler::kMaxMarkCompactsInIdleRound; i++) {
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_FULL_GC, action.type);
heap_state.incremental_marking_stopped = true;
heap_state.can_start_incremental_marking = false;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
- int idle_time_ms = heap_state.size_of_objects / speed + 1;
+ int idle_time_ms = static_cast<int>(heap_state.size_of_objects / speed + 1);
for (int i = 0; i < GCIdleTimeHandler::kMaxMarkCompactsInIdleRound; i++) {
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_FULL_GC, action.type);