Wait for the GC to quiesce before attempting foreground GCs.
Previously, dvmTrackExternalAllocation waited for the GC to complete before retrying its allocation. However, there is no guarantee that the GC will not be active at the time we are woken. Furthermore, the code did not revalidate that the external allocation is still possible, an assumption made by all externalAlloc calls. With this change, the code loops until the GC is no longer active, validates that the allocation is still possible, and then proceeds with its routine for allocating additional storage. In addition, if we try a few heroic measures to establish the externalAllocPossible invariant rather than immediately failing the call. Change-Id: I2e3b8a6c9fab617990edc085f52d0df35ad6d0f6
Loading
Please sign in to comment