[foreign-jextract] [Rev 01] RFR: 8239128: Macro defines constant pointers can crash VM via jextract API
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Thu Feb 20 22:06:51 UTC 2020
On Thu, 20 Feb 2020 21:44:12 GMT, Henry Jen <henryjen at openjdk.org> wrote:
>> Good point, in case of pointer to pointer, current way of create pointer type will add another pointer and that could lead to issues. I'll add a test case to that.
>>
>> However, we are setting for the resolveTypeReferences after we finished parsing a header, thus all types suppose to be known, and there is no more reason not to create pointer with pointee type directly.
>
> I had something like this before, but as you can see, it's only used by Pointer, thus I simply consolidated them.
>
> We cannot use j.i.clang.Type for identity, as the equal method could actually call into native code. The fact that same type not necessary by same instance of CXType struct actually bit me when I use clang.Type as key for unresolved map instead of plain list.
I mean - `IdentityHashMap`? I know that equals goes into native, I'm saying let's just use the object identity.
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/21
More information about the panama-dev
mailing list