Page History
...
Code Block | ||
---|---|---|
| ||
cdef size_t payload = 0 payload = d.xtc.extent - sizeof(Xtc) view_ptr += sizeof(Dgram) + payload |
From C++ Dgram to Python
Python Dgram object can be created in two ways:
- Using file descriptor: This way, a memory space is allocated and deallocated by the Dgram class.
- Using view (ant buffer-interface Python objects): Dgram class handles reference count for the given view object.
One way to cleanly pass a C++ Dgram to Python is to copy the contents to a buffer-interface object and create a Python Dgram from it. With this method, the life-time of the memory location is handled by the Python Dgram class.
Overview
Content Tools