RFR: 8254231: Implementation of Foreign Linker API (Incubator) [v7]

Paul Sandoz psandoz at openjdk.java.net
Thu Oct 22 16:17:20 UTC 2020


On Thu, 22 Oct 2020 13:30:13 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java line 126:
>> 
>>> 124:      *
>>> 125:      * @param symbol   downcall symbol.
>>> 126:      * @param type     the method type.
>> 
>> s/method type/carrier type ?
>
> Not sure about this one? E.g. in my mental model, I often have seen "carrier type" associated with j.l.Class ?

Ah, i see, i find it confusing that "carrier type" is mentioned in the `@throws`, and was assuming it was an alias for method type, did you really mean method type?

>> src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java line 139:
>> 
>>> 137:      *
>>> 138:      * <p>The returned segment is <em>not</em> thread-confined, and it only features
>>> 139:      * the {@link MemorySegment#CLOSE} access mode. When the returned segment is closed,
>> 
>> Implying that it is shared? If so might be better to state that directly (with a link), and can be closed explicitly or left until can be collected by the GC?
>
> `The returned segment is <em>not</em> thread-confined` ? Since it features CLOSE, it can be closed explicitly - I'm not sure 100% of what additional clarification is required - but I'm happy to make this clearer (I need more info).

Sometimes it's clearer to state the non-negative term i.e. _shared_ which is now something more explicit e.g.
> The returned segment is _shared_ [add link?] (not thread-confined)

That is really what i was trying to get at, rather than the CLOSE+GC aspects.

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

PR: https://git.openjdk.java.net/jdk/pull/634



More information about the security-dev mailing list