[crac] RFR: 8375044: [CRaC] Structured engine options info [v4]

Radim Vansa rvansa at openjdk.org
Tue Jan 20 14:48:28 UTC 2026


On Mon, 19 Jan 2026 09:15:54 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:

>> src/hotspot/share/include/crlib/crlib_description.h line 42:
>> 
>>> 40:   RESTORE    = 1 << 1,
>>> 41:   DEPRECATED = 1 << 2,
>>> 42: } crlib_conf_option_flag_t;
>> 
>> There may be a problem with ABI compatibility if we'll add more values in the future. Since we do not fix an underlying type (we cannot as this is a C99 API) the compiler is free to choose any integer type not larger than int that can represent all listed values. I suggest adding an upper-bound value that will ensure that either int or unsigned int is the underlying type and only unsigned values are used (on popular data models): `MAX = 0x7FFFFFFF`. The value is not supposed to be actually used.
>> 
>> Although maybe this is too paranoid.
>
> If we choose to apply this, the same should be done for `crlib_bitmap_comparison_t`

OK, you convinced me that C's enums are not good for ABI compatilibility, and are annoying as these need to be globally unique identifiers.

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

PR Review Comment: https://git.openjdk.org/crac/pull/286#discussion_r2708667106


More information about the crac-dev mailing list