Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v2]

2022-11-21 Thread Maurizio Cimadamore
On Mon, 21 Nov 2022 12:03:35 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/util/zip/Adler32.java line 102: >> >>> 100: return; >>> 101: if (buffer.isDirect()) { >>> 102: try (var sessionAcquisition = >>>

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v2]

2022-11-21 Thread Per Minborg
> This PR proposes the introduction of **guarding** of the use of > `DirectBuffer::address` within the JDK. With the introduction of the Foreign > Function and Memory access, it is possible to derive Buffer instances that > are backed by native memory that, in turn, can be closed asynchronously

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v2]

2022-11-21 Thread Alan Bateman
On Mon, 21 Nov 2022 12:16:01 GMT, Maurizio Cimadamore wrote: >> Eventually, I hope most of them will be named `_`. > > maybe just `bufferLock` and and just `acquireBuffer` ? Would it be possible to re-examine acquireSession returning Runnable and acquireSessionAsAutoCloseable returning