8289570: SegmentAllocator:allocateUtf8String(String str) default behavior mismatch to spec

Reviewed-by: alanb, psandoz
This commit is contained in:
Maurizio Cimadamore 2022-07-01 21:46:07 +00:00
parent 20124ac755
commit 8e01ffb3a7
2 changed files with 20 additions and 1 deletions

View file

@ -146,7 +146,7 @@ public final class Utils {
}
public static MemorySegment toCString(byte[] bytes, SegmentAllocator allocator) {
MemorySegment addr = allocator.allocate(bytes.length + 1, 1L);
MemorySegment addr = allocator.allocate(bytes.length + 1);
copy(addr, bytes);
return addr;
}