git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Cc: git@vger.kernel.org, l.s.r@web.de
Subject: Re: [RFC PATCH] http: use xmalloc with cURL
Date: Sun, 11 Aug 2019 13:20:26 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1908111317540.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20190810220251.3684-1-carenas@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]

Hi,


On Sat, 10 Aug 2019, Carlo Marcelo Arenas Belón wrote:

> 4a30976e28 ([PATCH] support older versions of libcurl, 2005-07-28) added
> support for conditionally initializing cURL but when f0ed8226c9
> (Add custom memory allocator to MinGW and MacOS builds, 2009-05-31) that
> support wasn't updated to make sure cURL will use the same allocator than
> git if compiled with USE_NED_ALLOCATOR=YesPlease (usually done in Windows)
>
> tested in macOS 10.14.6 with the system provided cURL (7.54.0)
> and latest (7.65.3) and while the API used should be added starting around
> 7.12.0 (mid 2014). couldn't get a release that old to build and therefore
> the current mismatch is unlikely to be found while testing because of that.
>
> cURL is very strict about its allocator being thread safe and so that might
> be an issue to look for.

Looks good to me.

Please note that this did not cause problems in Git for Windows.
Probably because we leave it to cURL to deallocate whatever it
allocated.

Still, it is a good idea to ask libcurl to use the same allocator as Git.

Thanks,
Dscho

> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  http.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/http.h b/http.h
> index b429f1cf04..59ec4cbd30 100644
> --- a/http.h
> +++ b/http.h
> @@ -27,6 +27,9 @@
>  #endif
>  #if LIBCURL_VERSION_NUM < 0x070800
>  #define curl_global_init(a) do { /* nothing */ } while (0)
> +#else
> +#define curl_global_init(a) curl_global_init_mem(a, xmalloc, free, \
> +						xrealloc, xstrdup, xcalloc)
>  #endif
>
>  #if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)
> --
> 2.23.0.rc2
>
>

  parent reply	other threads:[~2019-08-11 11:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-10 22:02 [RFC PATCH] http: use xmalloc with cURL Carlo Marcelo Arenas Belón
2019-08-10 22:17 ` Daniel Stenberg
2019-08-10 22:41   ` Carlo Arenas
2019-08-11 11:20 ` Johannes Schindelin [this message]
2019-08-11 19:08   ` Carlo Arenas
2019-08-12 19:23     ` Johannes Schindelin
2019-08-12 19:55     ` Jeff King
2019-08-12 20:04       ` Junio C Hamano
2019-08-12 20:50         ` Jeff King
2019-08-13 20:00         ` Johannes Schindelin
2019-08-14 16:01           ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.1908111317540.46@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).