[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wget-dev] wget2 | Make wget allocation functions overridable functi

From: Darshit Shah
Subject: Re: [Wget-dev] wget2 | Make wget allocation functions overridable function pointers (d5e648e8)
Date: Tue, 18 Jun 2019 20:57:28 +0000

Darshit Shah started a new discussion on include/wget/wget.h: 

> -     wget_realloc(void *ptr, size_t size) G_GNUC_WGET_ALLOC_SIZE(2);
> -WGETAPI void
> -     wget_free(void *ptr);
> -WGETAPI void
> -     wget_set_oomfunc(wget_oom_callback_t);
> +/// Type of malloc() function
> +typedef void *(*wget_malloc_function) (size_t);
> +/// Type of calloc() function
> +typedef void *(*wget_calloc_function) (size_t, size_t);
> +/// Type of realloc() function
> +typedef void *(*wget_realloc_function) (void *, size_t);
> +/// Type of free() function
> +typedef void (*wget_free_function) (void *);
> +
> +/* For use in callbacks */
> +extern WGETAPI wget_malloc_function wget_malloc;

Need to add documentation about these symbols and how the user can set them.

Maybe we can even have the functions that we use in `wget2` as an example for 
each of them

Reply to this email directly or view it on GitLab: 
You're receiving this email because of your account on gitlab.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]