Re: [Libguestfs] [libnbd PATCH v4 05/25] golang: Change logic of copy_uint32_array

2023-08-08 Thread Laszlo Ersek
On 8/8/23 13:36, Nir Soffer wrote: > On Thu, Aug 3, 2023 at 4:57 AM Eric Blake wrote: >> >> Commit 6725fa0e12 changed copy_uint32_array() to utilize a Go hack >> for accessing a C array as a Go slice in order to potentially benefit >> from any optimizations in Go's copy() for bulk transfer of memo

Re: [Libguestfs] [libnbd PATCH v4 05/25] golang: Change logic of copy_uint32_array

2023-08-08 Thread Eric Blake
On Tue, Aug 08, 2023 at 01:15:16PM +0100, Richard W.M. Jones wrote: > On Tue, Aug 08, 2023 at 02:36:12PM +0300, Nir Soffer wrote: > > On Thu, Aug 3, 2023 at 4:57 AM Eric Blake wrote: > > > func copy_uint32_array(entries *C.uint32_t, count C.size_t) []uint32 { > > > +if (uint64(count) > 64*102

Re: [Libguestfs] [libnbd PATCH v4 05/25] golang: Change logic of copy_uint32_array

2023-08-08 Thread Richard W.M. Jones
On Tue, Aug 08, 2023 at 02:36:12PM +0300, Nir Soffer wrote: > On Thu, Aug 3, 2023 at 4:57 AM Eric Blake wrote: > > func copy_uint32_array(entries *C.uint32_t, count C.size_t) []uint32 { > > +if (uint64(count) > 64*1024*1024) { > > +panic(\"violation of state machine guarantee\") > >

Re: [Libguestfs] [libnbd PATCH v4 05/25] golang: Change logic of copy_uint32_array

2023-08-08 Thread Nir Soffer
On Thu, Aug 3, 2023 at 4:57 AM Eric Blake wrote: > > Commit 6725fa0e12 changed copy_uint32_array() to utilize a Go hack for > accessing a C array as a Go slice in order to potentially benefit from > any optimizations in Go's copy() for bulk transfer of memory over > naive one-at-a-time iteration.

Re: [Libguestfs] [libnbd PATCH v4 05/25] golang: Change logic of copy_uint32_array

2023-08-07 Thread Laszlo Ersek
On 8/4/23 11:16, Richard W.M. Jones wrote: > On Wed, Aug 02, 2023 at 08:50:25PM -0500, Eric Blake wrote: >> Commit 6725fa0e12 changed copy_uint32_array() to utilize a Go hack for >> accessing a C array as a Go slice in order to potentially benefit from >> any optimizations in Go's copy() for bulk t

Re: [Libguestfs] [libnbd PATCH v4 05/25] golang: Change logic of copy_uint32_array

2023-08-04 Thread Richard W.M. Jones
On Wed, Aug 02, 2023 at 08:50:25PM -0500, Eric Blake wrote: > Commit 6725fa0e12 changed copy_uint32_array() to utilize a Go hack for > accessing a C array as a Go slice in order to potentially benefit from > any optimizations in Go's copy() for bulk transfer of memory over > naive one-at-a-time ite