Skip to content

Commit 9f41464

Browse files
committed
Remember to multiply the size for malloc by the type size.
1 parent 8c4783f commit 9f41464

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/truffleruby/core/array/NativeArrayNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static abstract class NativeArrayNewStoreNode extends ArrayOperationNodes
8888

8989
@Specialization
9090
protected NativeArrayStorage newStore(int size) {
91-
Pointer pointer = Pointer.malloc(size);
91+
Pointer pointer = Pointer.malloc(size * 8);
9292
pointer.enableAutorelease(getContext().getFinalizationService());
9393
return new NativeArrayStorage(pointer, size);
9494
}

0 commit comments

Comments
 (0)