public final Object marshal(Invocation invocation, IRubyObject parameter) {
// Ruby strings are UTF-8, so should be able to just copy directly
final ByteList bl = parameter.asString().getByteList();
final int strlen = bl.length();
final Memory memory = new Memory(strlen + 1);
memory.write(0, bl.unsafeBytes(), bl.begin(), strlen);
memory.setByte(bl.length(), (byte) 0);
//
// Arrange for the bytes to be copied back after the function is called
//