MCPcopy Index your code
hub / github.com/ZeroIntensity/pointers.py / __init__

Method __init__

src/pointers/c_pointer.py:77–90  ·  view source on GitHub ↗
(self, address: int)

Source from the content-addressed store, hash-verified

75
76class FunctionPointer(BaseCPointer[Callable[P, T]]): # type: ignore
77 def __init__(self, address: int) -> None:
78 cb = deref(address)
79 add_ref(cb)
80 self._decref = True
81 self._address = address
82 mapped: "ctypes._FuncPointer" = get_mapped(cb) # type: ignore
83
84 @ctypes.CFUNCTYPE(mapped._restype_, *mapped._argtypes_) # type: ignore
85 def transport(*args, **kwargs):
86 cb(*args, **kwargs)
87
88 add_ref(transport)
89 self._transport = transport
90 self._size = ctypes.sizeof(transport)
91
92 @handle
93 def _cleanup(self) -> None:

Callers

nothing calls this directly

Calls 3

derefFunction · 0.85
add_refFunction · 0.85
get_mappedFunction · 0.85

Tested by

no test coverage detected