allocate

fun allocate(size: Int): Buffer(source)
fun allocate(size: Long): Buffer(source)

Allocates a native memory region of size bytes and returns a Buffer for reading and writing it.

Throws

if size is not positive.

if there is not enough memory available.