def execute(self, space, cppmethod, cppthis, num_args, args): lresult = capi.c_call_l(space, cppmethod, cppthis, num_args, args) ccpresult = rffi.cast(rffi.CCHARP, lresult) if ccpresult == rffi.cast(rffi.CCHARP, 0): return space.wrap("") result = rffi.charp2str(ccpresult) # TODO: make it a choice to free return space.wrap(result)
def execute(self, space, cppmethod, cppthis, num_args, args): if hasattr(space, "fake"): raise NotImplementedError lresult = capi.c_call_l(cppmethod, cppthis, num_args, args) address = rffi.cast(rffi.ULONG, lresult) arr = space.interp_w(W_Array, unpack_simple_shape(space, space.wrap(self.typecode))) return arr.fromaddress(space, address, sys.maxint)
def execute(self, space, cppmethod, cppthis, num_args, args): if hasattr(space, "fake"): raise NotImplementedError lresult = capi.c_call_l(space, cppmethod, cppthis, num_args, args) ptrval = rffi.cast(rffi.ULONG, lresult) arr = space.interp_w(W_Array, unpack_simple_shape(space, space.wrap(self.typecode))) if ptrval == 0: from pypy.module.cppyy import interp_cppyy return interp_cppyy.get_nullptr(space) return arr.fromaddress(space, ptrval, sys.maxint)
def execute(self, space, cppmethod, cppthis, num_args, args): if hasattr(space, "fake"): raise NotImplementedError lresult = capi.c_call_l(space, cppmethod, cppthis, num_args, args) ptrval = rffi.cast(rffi.ULONG, lresult) arr = space.interp_w( W_Array, unpack_simple_shape(space, space.wrap(self.typecode))) if ptrval == 0: from pypy.module.cppyy import interp_cppyy return interp_cppyy.get_nullptr(space) return arr.fromaddress(space, ptrval, sys.maxint)
def execute(self, space, cppmethod, cppthis, num_args, args): if hasattr(space, "fake"): raise NotImplementedError lresult = capi.c_call_l(space, cppmethod, cppthis, num_args, args) address = rffi.cast(rffi.ULONG, lresult) arr = space.interp_w(W_Array, unpack_simple_shape(space, space.wrap(self.typecode))) if address == 0: # TODO: fix this hack; fromaddress() will allocate memory if address # is null and there seems to be no way around it (ll_buffer can not # be touched directly) nullarr = arr.fromaddress(space, address, 0) assert isinstance(nullarr, W_ArrayInstance) nullarr.free(space) return nullarr return arr.fromaddress(space, address, sys.maxint)
def execute(self, space, cppmethod, cppthis, num_args, args): if hasattr(space, "fake"): raise NotImplementedError lresult = capi.c_call_l(space, cppmethod, cppthis, num_args, args) return self.wrap_result(space, lresult)
def execute(self, space, cppmethod, cppthis, num_args, args): from pypy.module.cppyy import interp_cppyy long_result = capi.c_call_l(space, cppmethod, cppthis, num_args, args) ptr_result = rffi.cast(capi.C_OBJECT, long_result) pyres = interp_cppyy.wrap_cppobject(space, ptr_result, self.cppclass) return pyres
def execute(self, space, cppmethod, cppthis, num_args, args): from pypy.module.cppyy import interp_cppyy long_result = capi.c_call_l(cppmethod, cppthis, num_args, args) ptr_result = rffi.cast(capi.C_OBJECT, long_result) return interp_cppyy.wrap_cppobject( space, space.w_None, self.cppclass, ptr_result, isref=False, python_owns=False)
def execute(self, space, cppmethod, cppthis, num_args, args): result = capi.c_call_l(cppmethod, cppthis, num_args, args) return self._wrap_result(space, result)