dissecting memory sessions

Pedro Lamarão pedro.lamarao at prodist.com.br
Thu Nov 3 15:44:30 UTC 2022


Em qui., 3 de nov. de 2022 às 12:18, Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> escreveu:

> On 03/11/2022 14:07, Radosław Smogura wrote:
>
> Hi Maurizo,
>
>
>
> Thank you for sharing this approach. I would have question related to
> closing arenas, and I was thinking about creating pooling arena which will
> return allocated segments back to the pool like in case of pooling
> allocator.
>
>
>
> Firstly, minor thing, Arena class is sealed so I can’t create wrapper
> around it?
>
> I don't think Arena needs to be sealed, as there's nothing too magic about
> it. Opening it up allows clients to decorate arenas easily. But either way,
> it would be similarly easy for a client to define another class which
> implements both SegmentAllocator and AutoCloseable, which wraps an Arena.
>

I agree it is easy to define an internal allocator interface in an
application or framework.
Libraries, however, would be required to define their own, public allocator
interface for configuration and mocking.
It is incredibly valuable for library authors to have common, universal
interfaces defined by the platform for this sort of thing.
I believe @NotNull is the go-to example for this kind of missing shared
definition.

-- 
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20221103/98d9cf7b/attachment.htm>


More information about the panama-dev mailing list