search for: nbdkit_memdup_intern

Displaying 3 results from an estimated 3 matches for "nbdkit_memdup_intern".

2020 Aug 26
2
Re: [nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
...gt; worried about API proliferation and more about ease-of-use. Time for some name bike-shedding. How about: nbdkit_strdup_intern (const char *) nbdkit_strndup_intern (const char *s, size_t) and if we need something that permits embedded NUL (right now I don't have such a use) we could add nbdkit_memdup_intern (const void *s, size_t) -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
2020 Aug 26
0
Re: [nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
...about ease-of-use. > > Time for some name bike-shedding. How about: > > nbdkit_strdup_intern (const char *) > nbdkit_strndup_intern (const char *s, size_t) > > and if we need something that permits embedded NUL (right now I > don't have such a use) we could add > nbdkit_memdup_intern (const void *s, size_t) Seems good to me. Do you think we'll be able to get the final APIs into nbdkit this week? I don't much care about finishing the implementation, just that any APIs we add wont need to be changed later. Rich. -- Richard Jones, Virtualization Group, Red Hat http:/...
2020 Aug 25
3
Re: [nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
On Tue, Aug 25, 2020 at 10:46:57AM -0500, Eric Blake wrote: > + const char *nbdkit_string_intern (const char *str); > + > +Returns a copy of str, so that the caller may reclaim str and use the > +copy in its place. If the copy is created outside the scope of a > +connection (such as during C<.load>), the lifetime of the copy will > +last at least through C<.unload>;