return self.send(callsite.mproperty, args)
end
+ fun native_array_instance(elttype: MType, length: RuntimeVariable): RuntimeVariable is abstract
+
fun calloc_array(ret_type: MType, arguments: Array[RuntimeVariable]) is abstract
fun native_array_def(pname: String, ret_type: nullable MType, arguments: Array[RuntimeVariable]) is abstract
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))
return res
end
- fun native_array_instance(elttype: MType, length: RuntimeVariable): RuntimeVariable
+ redef fun native_array_instance(elttype: MType, length: RuntimeVariable): RuntimeVariable
do
var mtype = self.get_class("NativeArray").get_mtype([elttype])
self.require_declaration("NEW_{mtype.mclass.c_name}")
return res
end
+ redef fun native_array_instance(elttype, length)
+ do
+ var nclass = self.get_class("NativeArray")
+ var mtype = nclass.get_mtype([elttype])
+ var res = self.new_var(mtype)
+ res.is_exact = true
+ self.require_declaration("NEW_{nclass.c_name}")
+ self.add("{res} = NEW_{nclass.c_name}({length});")
+ return res
+ end
+
redef fun array_instance(array, elttype)
do
var nclass = self.get_class("NativeArray")