Avoid decrementing iterator to std::set<>::begin() in RosAlloc.

Avoid undefined behavior in the expression
    free_page_runs_.erase(it--);
when it == free_page_runs_.begin().

Also avoid the similar expression
    free_page_runs_.erase(it++)
even though it's always well-defined.

In practice, the undefined behavior has no observable
side effects with the std::set<> implementation we use.
Therefore a regression test is not feasible.

Test: m test-art-host
Change-Id: I4bdeb6cdd068fe5da416b0e66953d5620ad5e999
1 file changed