[foreign-memaccess+abi] RFR: 8296417: Make memory session a pure lifetime abstraction [v8]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Nov 9 10:32:45 UTC 2022
On Wed, 9 Nov 2022 09:35:43 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> I think that `Arena` is a bad name. And if I read the document correctly, `MemorySession` is now a bad name, too, since essentially a `MemorySession` only allows read operations, it acts more like a view than a true session. Thanks a lot.
>
>> I think that `Arena` is a bad name. And if I read the document correctly, `MemorySession` is now a bad name, too, since essentially a `MemorySession` only allows read operations, it acts more like a view than a true session. Thanks a lot.
>
> Names can be changed. I agree that `MemorySession` seems suboptimal now. We were thinking of other candidates like `SegmentScope`.
>
> That said, I'd like to understand more where the problem is with `Arena`, can you please expand on why you think it's not a great name? Thanks.
> @mcimadamore I think `Arena` is a word indicating mainly spacial properties, using it as a pure temporal abstraction seems unrelated and potentially misleading.
But the pure temporal abstraction is MemorySession, not Arena (hence why you need to go from Arena to a session to e.g. map a segment).
>
> Moreover, in memory contexts, an arena is often used to indicate a contiguous piece of memory that can be sliced out to satisfy requested allocations. As a result, using it for an orthogonal responsibility may be confusing.
Ok, so your angle is: Arena is an allocator with very specific properties. I think that's fair - although Arena is also an allocator - and preserves a main properties or arena allocators - which is that when the arena is closed, all the memory is invalidated at once. It seems like the fact that the arena is contiguous or not under the hood (which is an impl change which we might in fact improve over time) should not be too much of a distraction?
>
> Thank you very much.
-------------
PR: https://git.openjdk.org/panama-foreign/pull/750
More information about the panama-dev
mailing list