X-Git-Url: http://nitlanguage.org diff --git a/src/global_compiler.nit b/src/global_compiler.nit index 44ec3a1..8c6ac6c 100644 --- a/src/global_compiler.nit +++ b/src/global_compiler.nit @@ -353,6 +353,12 @@ class GlobalCompilerVisitor end end + redef fun native_array_instance(elttype: MType, length: RuntimeVariable): RuntimeVariable + do + var ret_type = self.get_class("NativeArray").get_mtype([elttype]) + return self.new_expr("NEW_{ret_type.c_name}({length})", ret_type) + end + redef fun calloc_array(ret_type, arguments) do self.ret(self.new_expr("NEW_{ret_type.c_name}({arguments[1]})", ret_type))