[foreign-jextract] [Rev 01] RFR: 8239128: Macro defines constant pointers can crash VM via jextract API
Henry Jen
henryjen at openjdk.java.net
Fri Feb 21 03:19:31 UTC 2020
On Fri, 21 Feb 2020 01:08:42 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> The pull request has been updated with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase.
>
> src/jdk.incubator.jextract/share/classes/jdk/incubator/jextract/Type.java line 426:
>
>> 425: */
>> 426: static Type.Function function(boolean varargs, Type returnType, Type... arguments) {
>> 427: return new TypeImpl.FunctionImpl(varargs, Stream.of(arguments).collect(Collectors.toList()), returnType);
>
> This shouldn't be removed! It's the only way for a client to create mutually referring pointer types.
This change is what I meant at beginning to make this an implementation detail.
I have trouble to figure out how to use this API without an API providing something like the TypeReference, which I can implement as a Type that is a transparent delegate.
Imagine Type.declare(Declareation.struct(pos, "foo", Type.pointer(<what can I do to provide this struct type>)).
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/21
More information about the panama-dev
mailing list