RFR(S) 8148944: CollectorPolicy methods for memory allocations are specific to GenCollectorPolicy
Kim Barrett
kim.barrett at oracle.com
Wed Feb 3 20:20:05 UTC 2016
> On Feb 3, 2016, at 1:40 PM, Mikael Gerdin <mikael.gerdin at oracle.com> wrote:
>
> Hi,
>
> Please review this small cleanup to reduce the public API of CollectorPolicy.
>
> CollectorPolicy::mem_allocate_work and satisfy_failed_allocation are pure virtuals on CollectorPolicy but are only used by GenCollectorPolicy/GenCollectedHeap. The other collectors stub the methods out with fatal errors if they are called.
>
> My fix is to move the methods to GenCollectorPolicy and let GenCollectedHeap access them through its typed pointer to the Gen policy.
>
> I've also taken the opportunity to remove the "virtual" keyword from satsfy_failed_metadata_allocation(), it has never been overridden by any CollectorPolicy subclass. If that is desirable then it can easily be reinstated.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8148944
> Webrev: http://cr.openjdk.java.net/~mgerdin/8148944/webrev.0/
> Testing: Just a local build and testing with GCBasher.
>
> Thanks
> /Mikael
Looks good.
A couple minor comments; don't need a new webrev for these.
------------------------------------------------------------------------------
Update copyrights.
------------------------------------------------------------------------------
src/share/vm/gc/shared/collectorPolicy.hpp
Update indentation of parameters for satisfy_failed_metadata_allocation.
[Unless webrev isn't showing me the whitespace-only changes.]
------------------------------------------------------------------------------
More information about the hotspot-gc-dev
mailing list