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

ExE Boss duke at openjdk.org
Sun Jan 28 01:00:40 UTC 2024


On Fri, 12 Jan 2024 14:35:01 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.
>
> Per Minborg has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Update copyright year
>  - Add test for zero-out

test/jdk/java/foreign/TestScope.java line 150:

> 148:     }
> 149: 
> 150:     private static final MemorySegment ZEROED_MEMORY = MemorySegment.ofArray(new byte[8102]);

The nearest power of two is 8192 (2<sup>13</sup>):
Suggestion:

    private static final MemorySegment ZEROED_MEMORY = MemorySegment.ofArray(new byte[8192]);

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

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


More information about the core-libs-dev mailing list