runtime.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:blackmamba 作者: zrzka 项目源码 文件源码
def __init__(self, block_ptr, restype=None, argtypes=None):
        self._block_ptr = block_ptr
        self._block = cast(self._block_ptr, POINTER(_Block))

        if not argtypes:
            argtypes = []

        if self._regular_calling_convention():
            # First arg is pointer to block, hide it from user
            argtypes.insert(0, c_void_p)

        if self._has_signature():
            # TODO - Validate restype & argtypes against signature
            #      - Signature is not always populated
            pass

        self._func = None

        if self._regular_calling_convention():
            IMPTYPE = CFUNCTYPE(restype, *argtypes)
            self._func = IMPTYPE(self._block.contents.invoke)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号