[foreign-memaccess+abi] RFR: 8270376: Finalize API for memory copy [v9]

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Aug 11 21:44:06 UTC 2021


I've resurrected an older conversation here:

https://mail.openjdk.java.net/pipermail/panama-dev/2021-April/013191.html

At that time we discussed using a custom allocator to track allocation 
pressure. I think that's still the way to go.

Adding more features on ResourceScope is IMHO not the way to go, given 
that a ResourceScope is not used just for memory segments. If you want 
to keep track of how much memory is allocated, likely you need a custom 
allocator which has the ability to do that, and react accordingly, which 
is why the SegmentAllocator is there. Note that a SegmentAllocator can 
be built on top of a scope, e.g. you don't have to give up scopes (see 
what we do for arena allocators): e.g. you start with a scope, wrap it 
into an allocator and then use the allocator.

Maurizio

On 11/08/2021 22:29, Maurizio Cimadamore wrote:
> I have to admit, I have trouble understanding what you are proposing - 
> e.g. what this callback would be for. What calls to resource scope do 
> you wish to intercept? 


More information about the panama-dev mailing list