Skip to content

Commit

Permalink
Whoops, wrong malloc
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-OOG-ah committed Nov 27, 2024
1 parent 70ffe74 commit 8982cf1
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,18 +331,14 @@ public long ncalloc(int alignment, int num, int size) {
// -------------------------------------------------

/**
* Allocates an aligned {@link ByteBuffer} on the stack.
* Allocates a {@link ByteBuffer} on the stack with {@code alignment} equal to {@link Pointer#POINTER_SIZE POINTER_SIZE}.
*
* @param alignment the required buffer alignment
* @param size the number of elements in the buffer
* @param size the number of elements in the buffer
*
* @return the allocated buffer
*/
public ByteBuffer malloc(int alignment, int size) {
if (/*DEBUG*/ false) {
checkAlignment(alignment);
}
return wrapBufferByte(nmalloc(alignment, size), size);
public ByteBuffer malloc(int size) {
return wrapBufferByte(nmalloc(POINTER_SIZE, size), size);
}

// -------------------------------------------------
Expand Down

0 comments on commit 8982cf1

Please sign in to comment.