RFR: 8274910: Compile in G1 evacuation failure injection code based on define [v2]
Thomas Schatzl
tschatzl at openjdk.java.net
Tue Oct 19 10:44:22 UTC 2021
On Mon, 18 Oct 2021 14:37:56 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
>>
>> ayang review
>
> src/hotspot/share/gc/g1/g1_globals.hpp line 36:
>
>> 34: #elif !defined(EVAC_FAILURE_INJECTOR)
>> 35: #define EVAC_FAILURE_INJECTOR 0
>> 36: #endif
>
> Since the intended use case to include evac-fail code in a release build for perf evalucation, instead of accepting an already-defined `EVAC_FAILURE_INJECTOR`, one can bluntly reject it to make the intention more explicitly: this `#define` is the authoritative source of `EVAC_FAILURE_INJECTOR`. Sth along the lines of:
>
>
> #ifdef EVAC_FAILURE_INJECTOR
> #error "EVAC_FAILURE_INJECTOR defined"
> #endif
> #ifdef PRODUCT
> ...
>
> When the need to cope with externally defined `EVAC_FAILURE_INJECTOR` arises (I doubt it), we can revisit this at that time.
>
> Ofc, this is quite subjective.
I do not mind either way, I mostly wanted to use the same constructs as we do for the task queue code. Changed it to your suggestions.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5851
More information about the hotspot-gc-dev
mailing list