[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:40:39 +0000 |
Tim Rühsen commented on a discussion on libwget/xalloc.c:
https://gitlab.com/gnuwget/wget2/commit/d5e648e82bf41da724ff3b613a60b6dd9493d80a#note_182895613
> - * This function is like free().
> - *
> - * It is basically needed on systems where the library malloc heap is
> different
> - * from the caller's malloc heap, which happens on Windows when the library
> - * is a separate DLL.
> - *
> - * To prevent typical use-after-free issues, use the macro wget_xfree().
> - */
> -void wget_free(void *ptr)
> -{
> - free(ptr);
> -}
> +wget_malloc_function wget_malloc = malloc;
> +wget_calloc_function wget_calloc = calloc;
> +wget_realloc_function wget_realloc = realloc;
> +wget_free_function wget_free = free;
No. Then each object file would have it's own version of those variables.
--
Reply to this email directly or view it on GitLab:
https://gitlab.com/gnuwget/wget2/commit/d5e648e82bf41da724ff3b613a60b6dd9493d80a#note_182895613
You're receiving this email because of your account on gitlab.com.