diff options
author | Hans Boehm <hboehm@google.com> | 2021-05-26 21:00:46 -0700 |
---|---|---|
committer | Hans Boehm <hboehm@google.com> | 2021-06-03 17:58:13 +0000 |
commit | b22fdeb3b80b99171bba64051e1dc5033418da79 (patch) | |
tree | b999f621307a3e0b0de9dfa7c5513e10c3f0b9d8 /libnativebridge/tests/CodeCacheCreate_test.cpp | |
parent | 74d0aed217603d95960e90e920b9d426371373da (diff) |
Ensure that ConcurrentGC always increments GC num
ConcurrentGC could end up waiting for a GC type like TrimSpaces()
that does not actually end up incrementing completed_gcs_.
It would erroneously think it was done, leaving gcs_requested_
> gcs_completed_, with no task running to perform the requested
GCs, but further requests getting ignored until the next explicit
or heap-overflow GC.
Make ConcurrentGC() actually perform a GC unless the GC number
was incremented. Add a CHECK in ConcurrentGCTask::Run that can catch
this. (Confirmed because it did catch it before we added the fix.)
Have RequestConcurrentGC() return a bool to indicate whether it
did anything. This makes another CHECK possible, and should
eventually allow us to again sleep() until a GC starts.
Bug: 186592536
Bug: 189150802
Test: Build and boot AOSP
Change-Id: Ib11734a9c87b9f9e19c5a3557eac9024f84cadf3
Merged-In: Ib11734a9c87b9f9e19c5a3557eac9024f84cadf3
(cherry picked from commit 20e77ff50047e62e90b3ce9b7849777ffcd55b0d)
Diffstat (limited to 'libnativebridge/tests/CodeCacheCreate_test.cpp')
0 files changed, 0 insertions, 0 deletions