Skip to content

Commit

Permalink
Fix array size calculation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jwharm committed Dec 12, 2024
1 parent 0f6b7d6 commit de4d7cb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ public static MemorySegment allocateNativeArray(Proxy[] array,

if (zeroTerminated)
// The array is zero-terminated by a struct with all members being 0
segment.asSlice(length * size, size).fill((byte) 0);
segment.asSlice(array.length * size, size).fill((byte) 0);

return segment;
}
Expand Down

0 comments on commit de4d7cb

Please sign in to comment.