MCPcopy Create free account
hub / github.com/libgit2/pygit2 / ptr_to_bytes

Function ptr_to_bytes

pygit2/utils.py:96–103  ·  view source on GitHub ↗

Convert a pointer coming from C code ( ) to a byte buffer containing the address that the pointer refers to.

(ptr_cdata)

Source from the content-addressed store, hash-verified

94
95
96def ptr_to_bytes(ptr_cdata) -> bytes:
97 """
98 Convert a pointer coming from C code (<cdata 'some_type *'>)
99 to a byte buffer containing the address that the pointer refers to.
100 """
101
102 pp = ffi.new('void **', ptr_cdata)
103 return bytes(ffi.buffer(pp)[:])
104
105
106@contextlib.contextmanager

Callers 1

_checkout_notify_cbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…