return allocate(context, sizeArg, clearArg.isTrue());
}
@JRubyMethod(name = { "alloc_in", "__alloc_in", "__alloc_heap_in", "__alloc_direct_in" }, meta = true)
public static JNABuffer allocateInput(ThreadContext context, IRubyObject recv, IRubyObject arg) {
if (arg instanceof RubyString) {
final RubyString s = (RubyString) arg;
final int size = Util.int32Value(s.length());
final ByteList bl = s.getByteList();
final JNAMemoryIO io = JNAMemoryIO.allocateDirect(size);
io.put(0, bl.unsafeBytes(), bl.begin(), bl.length());
io.putByte(bl.length(), (byte) 0);
return new JNABuffer(context.getRuntime(), io, 0, size);
} else {