summaryrefslogtreecommitdiff
path: root/libnativebridge/tests/NativeBridge3LoadLibraryExt_test.cpp
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2021-05-26 21:00:46 -0700
committer Hans Boehm <hboehm@google.com> 2021-06-02 01:21:36 +0000
commit20e77ff50047e62e90b3ce9b7849777ffcd55b0d (patch)
tree8877f8f91f3d2cafefac601e62f169009a52f4ea /libnativebridge/tests/NativeBridge3LoadLibraryExt_test.cpp
parent1d326f94a3fdd6292ccdf0022cedfb2a2b8acfee (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
Diffstat (limited to 'libnativebridge/tests/NativeBridge3LoadLibraryExt_test.cpp')
0 files changed, 0 insertions, 0 deletions