RFR: 8323159: Consider adding some text re. memory zeroing in Arena::allocate

Jorn Vernee jvernee at openjdk.org
Wed Jan 10 14:14:23 UTC 2024


On Mon, 8 Jan 2024 16:16:50 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to add a clarification that an `Arena` always returns zeroed-out segments for `Arena::allocate` methods.
> 
> Note that other overloaded methods refer to the abstract `Arena::allocate` method via implementation notes.

src/java.base/share/classes/java/lang/foreign/Arena.java line 269:

> 267:      * @implSpec
> 268:      * Implementations of this method must return a native, zero-initialized segment
> 269:      * featuring the requested size, and that is compatible with the provided alignment

Do we want to _mandate_ that all arenas return zero-initialized memory? Maybe it's enough to say that the default implementation does this.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17308#discussion_r1447440934


More information about the core-libs-dev mailing list