RFR: JDK-8302989: Add missing INCLUDE_CDS checks

Matthias Baesken mbaesken at openjdk.org
Tue Feb 28 13:05:06 UTC 2023


On Mon, 27 Feb 2023 10:08:43 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> It may be more profitable (and less work) if we change these variables to `const` when CDS is disabled:
> 
> ```
> extern bool DumpSharedSpaces;
> extern bool DynamicDumpSharedSpaces;
> extern bool RequireSharedSpaces;
> extern "C" {
> // Make sure UseSharedSpaces is accessible to the serviceability agent.
> extern JNIEXPORT jboolean UseSharedSpaces;
> }
> ```
> 
> But some changes may be needed in SA.

Hi Ioi, do you think this should be done for all 4  bools ?
Btw. when adding a const to UseSharedSpaces  I run into something like this (when compiling with gcc, seems there is some issue when const is used together with JNIEXPORT , any ideas why ?
`
globalDefinitions.cpp:50:26: error: 'visibility' attribute ignored [-Werror=attributes]`

-------------

PR: https://git.openjdk.org/jdk/pull/12691


More information about the hotspot-dev mailing list