New candidate JEP: 419: Foreign Function & Memory API (Second Incubator)
leerho
leerho at gmail.com
Tue Oct 12 18:20:15 UTC 2021
>
> Except that allocateNative does zero the memory :-) There are some
> obscure flags by which you can disable this, but in general that's the
> lay of the land.
Where are these "obscure flags" documented?
In general, where can I find documentation of all possible flags, say for
JDK 17?
If a more optimized allocator is needed, a
> SegmentAllocator is probably the way to go, in which there's more
> freedom as to how memory is actually allocated/inited.
Could you give an example of how to implement the
*SegmentAllocator::allocate(long,long)* method to return a new segment that
does not do memory zeroing? (presumably without having to use "obscure
flags" option)
Thanks & Regards,
Lee.
On Tue, Oct 12, 2021 at 5:06 AM Sebastian Stenzel <
sebastian.stenzel at gmail.com> wrote:
>
> > On 12. Oct 2021, at 13:13, Maurizio Cimadamore <
> maurizio.cimadamore at oracle.com> wrote:
> >
> >
> > On 12/10/2021 11:54, Sebastian Stenzel wrote:
> >> Oh well... good to know! :D
> >>
> >> While my assumption was wrong, the conclusion stays the same: It should
> be mentioned whether we can rely on one or the other behaviour.
> >>
> > For the records, in the current javadoc for
> MemorySegment::allocateNative I see this sentence:
> >
> >> The block of off-heap memory associated with the returned native memory
> segment is initialized to zero.
> >
> > Which is repeated across all the allocateNative factories.
> >
> > Maurizio
> >
>
> My bad, I must have missed this.
>
>
More information about the panama-dev
mailing list