[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Wget-dev] wget2 | Make wget allocation functions overridable functi
From: |
Tim Rühsen |
Subject: |
Re: [Wget-dev] wget2 | Make wget allocation functions overridable function pointers (d5e648e8) |
Date: |
Wed, 19 Jun 2019 07:42:20 +0000 |
Tim Rühsen commented on a discussion on include/wget/wget.h:
https://gitlab.com/gnuwget/wget2/commit/d5e648e82bf41da724ff3b613a60b6dd9493d80a#note_182896222
> wget_list_browse(const wget_list_t *list, wget_list_browse_t browse,
> void *context) G_GNUC_WGET_NONNULL((2));
>
> -/*
> - * Memory allocation routines
> +/**
> + * \ingroup libwget-xalloc
> + *
> + * Memory allocation function pointers
> + * @{
> */
>
> -// I try to never leave freed pointers hanging around
> +// Don't leave freed pointers hanging around
> #define wget_xfree(a) do { if (a) { wget_free((void *)(a)); a=NULL; } }
> while (0)
>
> -typedef void *(*wget_oom_callback_t)(int size);
2. is not relevant (as you say)
1. returning NULL is fine - I already started adding checks everywhere in the
library code. In wget2 itself we don't need check since we catch the NULL case
in our custom alloc functions and exit().
--
Reply to this email directly or view it on GitLab:
https://gitlab.com/gnuwget/wget2/commit/d5e648e82bf41da724ff3b613a60b6dd9493d80a#note_182896222
You're receiving this email because of your account on gitlab.com.