Displaying 4 results from an estimated 4 matches for "alloc_free_callbacks".
2019 Aug 12
0
[PATCH libnbd 1/7] api: Add semi-private function for freeing persistent data.
...void *user_data)
+{
+ int ret = -1;
+ size_t i;
+
+ if (ptr == NULL)
+ return 0;
+
+ nbd_internal_set_error_context ("nbd_add_free_callback");
+ pthread_mutex_lock (&h->lock);
+
+ /* Extend the list of callbacks in the handle. */
+ if (h->nr_free_callbacks >= h->alloc_free_callbacks) {
+ size_t new_alloc;
+ struct free_callback *new_callbacks;
+
+ if (h->alloc_free_callbacks == 0)
+ new_alloc = 8;
+ else
+ new_alloc = 2 * h->alloc_free_callbacks;
+
+ new_callbacks = realloc (h->free_callbacks,
+ sizeof (struct free_...
2019 Aug 12
2
Re: [PATCH libnbd 1/7] api: Add semi-private function for freeing persistent data.
..._t i;
> +
> + if (ptr == NULL)
> + return 0;
> +
> + nbd_internal_set_error_context ("nbd_add_free_callback");
> + pthread_mutex_lock (&h->lock);
> +
> + /* Extend the list of callbacks in the handle. */
> + if (h->nr_free_callbacks >= h->alloc_free_callbacks) {
> + size_t new_alloc;
> + struct free_callback *new_callbacks;
> +
> + if (h->alloc_free_callbacks == 0)
> + new_alloc = 8;
> + else
> + new_alloc = 2 * h->alloc_free_callbacks;
> +
> + new_callbacks = realloc (h->free_callbacks,
>...
2019 Aug 12
14
[PATCH libnbd 0/7] Add free callbacks and remove valid_flag.
As proposed here:
https://www.redhat.com/archives/libguestfs/2019-August/msg00130.html
I didn't actually read Eric's replies to that yet because I've been
concentrating on writing these patches all day. Anyway here they are
and I'll look at what Eric said about the proposal next.
Rich.
2019 Aug 12
0
Re: [PATCH libnbd 1/7] api: Add semi-private function for freeing persistent data.
...; http://austingroupbugs.net/view.php?id=1218)
I guess - didn't know about it. Seems like it's not available in
glibc yet?
> > + if (new_callbacks == NULL) {
> > + set_error (errno, "realloc");
> > + goto out;
> > + }
> > + h->alloc_free_callbacks = new_alloc;
> > + h->free_callbacks = new_callbacks;
> > + }
> > +
> > + /* Need to keep the list sorted by pointer so we can use bsearch.
> > + * Insert the new entry before the i'th entry.
> > + *
> > + * Note the same pointer can be ad...