Re: [Libguestfs] [libnbd PATCH v2 8/8] python: Make nbd.Buffer lighter-weight

2022-06-07 Thread Eric Blake
On Tue, Jun 07, 2022 at 02:20:35PM +0100, Richard W.M. Jones wrote: > On Mon, Jun 06, 2022 at 09:08:33PM -0500, Eric Blake wrote: > > Instead of storing a PyCapsule in _o and repeatedly doing lookups to > > dereference a stored malloc'd pointer, it is easier to just directly > > store a Python

Re: [Libguestfs] [libnbd PATCH v2 8/8] python: Make nbd.Buffer lighter-weight

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:33PM -0500, Eric Blake wrote: > Instead of storing a PyCapsule in _o and repeatedly doing lookups to > dereference a stored malloc'd pointer, it is easier to just directly > store a Python buffer-like object as _o. Track initialization via > ._init: absent for

[Libguestfs] [libnbd PATCH v2 8/8] python: Make nbd.Buffer lighter-weight

2022-06-06 Thread Eric Blake
Instead of storing a PyCapsule in _o and repeatedly doing lookups to dereference a stored malloc'd pointer, it is easier to just directly store a Python buffer-like object as _o. Track initialization via ._init: absent for nbd.Buffer(int), present for nbd.Buffer.from_bytearray or after we have