[crac] RFR: 8376959: [CRaC] Turn simengine into shared library [v8]
Timofei Pushkin
tpushkin at openjdk.org
Mon Feb 9 21:58:53 UTC 2026
On Fri, 6 Feb 2026 14:58:25 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> src/java.base/share/native/libcrcommon/crcommon.hpp line 74:
>>
>>> 72: void *image_constraints;
>>> 73: void *image_score;
>>> 74: };
>>
>> Since we want to use the C layer a more conventional way seems to be to move this definition to `crcommon.cpp` (it can even become a normal class with a constructor/destructor) and use composition instead of inheritance (engine classes would be `struct crlib_conf`s themselves, `bool init_conf(conf_t* conf, ...)` would become `conf_t* create_conf(...)`). These fields are not used directly anywhere except `crcommon.cpp` anyway.
>>
>> Otherwise the fields can at least become their actual types to remove the casts in `crcommon.cpp`.
>
> I want to keep the full extension definition in crcommon and with that I won't avoid either inheritance, or globally set function: in crcommon I need to be able to translate `crlib_conf_t` into `conf_t`. Which way would you prefer?
Ah, I see, extension methods require `crlib_conf_t`. Ok, let's keep the inheritance.
Field types can be improved anyway though:
class ImageConstraints;
class ImageScore;
struct crlib_conf {
ImageConstraints* image_constraints;
ImageScore* image_score;
};
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/289#discussion_r2781241183
More information about the crac-dev
mailing list