Skip to content

Commit

Permalink
8348976: MemorySegment::reinretpret should be force inlined
Browse files Browse the repository at this point in the history
Reviewed-by: liach
  • Loading branch information
JornVernee committed Jan 31, 2025
1 parent 7764742 commit 137ad5d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public MemorySegment asSlice(long offset, MemoryLayout layout) {

@Override
@CallerSensitive
@ForceInline
public final MemorySegment reinterpret(long newSize, Arena arena, Consumer<MemorySegment> cleanup) {
Objects.requireNonNull(arena);
return reinterpretInternal(Reflection.getCallerClass(), newSize,
Expand All @@ -137,12 +138,14 @@ public final MemorySegment reinterpret(long newSize, Arena arena, Consumer<Memor

@Override
@CallerSensitive
@ForceInline
public final MemorySegment reinterpret(long newSize) {
return reinterpretInternal(Reflection.getCallerClass(), newSize, scope, null);
}

@Override
@CallerSensitive
@ForceInline
public final MemorySegment reinterpret(Arena arena, Consumer<MemorySegment> cleanup) {
Objects.requireNonNull(arena);
return reinterpretInternal(Reflection.getCallerClass(), byteSize(),
Expand Down

0 comments on commit 137ad5d

Please sign in to comment.