search for: add_vector_empty_method

Displaying 2 results from an estimated 2 matches for "add_vector_empty_method".

2023 Feb 22
1
[libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY
On 2/22/23 09:17, Richard W.M. Jones wrote: > On Tue, Feb 21, 2023 at 05:23:52PM +0100, Laszlo Ersek wrote: >> This is doable, but I hope it's not expected that >> DEFINE_POINTER_VECTOR_TYPE() *enforce* that the element type be a pointer :) > > > You might ignore this for a first draft, but it is apparently possible > to statically detect this (at least, if using
2023 Feb 22
2
[libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY
...TER_VECTOR_TYPE() *enforce* that the element type be a pointer :) You might ignore this for a first draft, but it is apparently possible to statically detect this (at least, if using GCC/clang): https://stackoverflow.com/questions/19255148/check-if-a-macro-argument-is-a-pointer-or-not > > ADD_VECTOR_EMPTY_METHOD() instead of DEFINE_VECTOR_EMPTY() works for > > me. > > OK, ADD_VECTOR_EMPTY_METHOD() can work with the above. This sounds fine for now, and since these are implementation details we can always revisit them in future. Rich. -- Richard Jones, Virtualization Group, Red Hat http://pe...