mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8299862: OfAddress setter should disallow heap segments
Reviewed-by: jvernee
This commit is contained in:
parent
636976ada8
commit
945ef07564
5 changed files with 27 additions and 4 deletions
|
@ -1734,6 +1734,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
|
|||
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
|
||||
* memory segment.
|
||||
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
|
||||
* @throws UnsupportedOperationException if {@code value} is not a {@linkplain #isNative() native} segment.
|
||||
*/
|
||||
@ForceInline
|
||||
default void set(ValueLayout.OfAddress layout, long offset, MemorySegment value) {
|
||||
|
@ -2079,6 +2080,7 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
|
|||
* @throws IndexOutOfBoundsException when the access operation falls outside the <em>spatial bounds</em> of the
|
||||
* memory segment.
|
||||
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}.
|
||||
* @throws UnsupportedOperationException if {@code value} is not a {@linkplain #isNative() native} segment.
|
||||
*/
|
||||
@ForceInline
|
||||
default void setAtIndex(ValueLayout.OfAddress layout, long index, MemorySegment value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue