On Thu, 31 Oct 2024 13:42:03 GMT, Per Minborg <pminb...@openjdk.org> wrote:

>> This PR proposes to add a small text segment on the 
>> `MemorySegment::reinterpret` overloads that takes an Arena stating the 
>> responsibility of actually freeing reinterpreted segments lies with the 
>> *original* arena.
>
> Per Minborg has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains three additional 
> commits since the last revision:
> 
>  - Improve docs from comments made in the PR
>  - Merge branch 'master' into reinterpret-doc
>  - Add doc on original arena is responsible for freeing a segment

src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 773:

> 771:      *         of memory has been deallocated via the original arena 
> (use after free).</li>
> 772:      *     <li>The reinterpreted segments' region of memory will not be 
> deallocated
> 773:      *         when the <em>provided scope becomes invalid.</em>

Putting the emphasis like this seems a bit more natural to me:
Suggestion:

     *     <li>The reinterpreted segments' region of memory will <em>not</em> 
be deallocated
     *         when the provided scope becomes invalid.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21761#discussion_r1824535346

Reply via email to