[foreign-memaccess+abi] RFR: 8263018: Improve API for lifecycle of native resources [v10]

Paul Sandoz psandoz at openjdk.java.net
Mon Mar 15 17:21:26 UTC 2021


On Fri, 12 Mar 2021 22:31:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> A possible, improved naming for the two segment allocators:
> 
> SegmentAllocator.of(MemorySegment) -> SegmentAllocator.slicing(MemorySegment)
> SegmentAllocator.of(ResourceScope) -> SegmentAllocator.scoped(ResourceScope)
> 
> What do you think?

Yes, that's better. I find it hard to come up with a better concise name for the former, allocation returns a sliced prefix of the given segment, thus allocations are aliased, which is fundamentally different to all the other cases.

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

PR: https://git.openjdk.java.net/panama-foreign/pull/466


More information about the panama-dev mailing list