[foreign-memaccess+abi] RFR: 8306668: Some foreign tests fail on x86
Jorn Vernee
jvernee at openjdk.org
Fri Apr 21 13:12:10 UTC 2023
On Fri, 21 Apr 2023 10:15:01 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> test/micro/org/openjdk/bench/java/lang/foreign/libPtr.c line 39:
>>
>>> 37:
>>> 38: EXPORT long long id_ptr_long(void* ptr) {
>>> 39: return (long long)(size_t)ptr;
>>
>> Note - these benchmarks do not care about the fact that some bits in the original value could be dropped to the floor. The benchmark aims at comparing the performance of passing/returning longs with that of passing/returning segments (e.g. to make sure that escape analysis works its magic). As such, lossy conversions are immaterial here.
>
> I guess a different approach could be to avoid using `void*` and use `size_t` instead, which would still allow FFM to link correctly. If that is preferred I can do that instead.
I think this is a good solution.
-------------
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/828#discussion_r1173749029
More information about the panama-dev
mailing list