Allocate with malloc since ffi.new leads to unsupported C type conversion and trace abort.