Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-14 Thread Jeff King
On Tue, Aug 13, 2019 at 10:00:44PM +0200, Johannes Schindelin wrote: > > Jeff King writes: > > > > > I think it might be worth just eliminating the whole idea. > > > > I kinda like the simplification ;-) An even thinner wrapper that > > calls malloc() and dies if it gets NULL, without any "try-to

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-13 Thread Johannes Schindelin
Hi, On Mon, 12 Aug 2019, Junio C Hamano wrote: > Jeff King writes: > > > I think it might be worth just eliminating the whole idea. > > I kinda like the simplification ;-) An even thinner wrapper that > calls malloc() and dies if it gets NULL, without any "try-to-free" > logic. This is one of t

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-12 Thread Jeff King
On Mon, Aug 12, 2019 at 01:04:55PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I think it might be worth just eliminating the whole idea. > > I kinda like the simplification ;-) An even thinner wrapper that > calls malloc() and dies if it gets NULL, without any "try-to-free" > logic.

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-12 Thread Junio C Hamano
Jeff King writes: > I think it might be worth just eliminating the whole idea. I kinda like the simplification ;-) An even thinner wrapper that calls malloc() and dies if it gets NULL, without any "try-to-free" logic.

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-12 Thread Jeff King
On Sun, Aug 11, 2019 at 12:08:53PM -0700, Carlo Arenas wrote: > there is also the risk that xmalloc might not be sufficiently thread > safe (ex: when it triggers unuse_one_window() through the use of a > try_to_free_routine in packfile.c but we could mitigate the risk for > now by doing it only fi

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-12 Thread Johannes Schindelin
Hi Carlo, On Sun, 11 Aug 2019, Carlo Arenas wrote: > On Sun, Aug 11, 2019 at 4:20 AM Johannes Schindelin > wrote: > > On Sat, 10 Aug 2019, Carlo Marcelo Arenas Belón wrote: > > > cURL is very strict about its allocator being thread safe and so that > > > might > > > be an issue to look for. > >

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-11 Thread Carlo Arenas
On Sun, Aug 11, 2019 at 4:20 AM Johannes Schindelin wrote: > On Sat, 10 Aug 2019, Carlo Marcelo Arenas Belón wrote: > > cURL is very strict about its allocator being thread safe and so that might > > be an issue to look for. > > Looks good to me. it is not ready yet for using though, at minimum I

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-11 Thread Johannes Schindelin
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 upda

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-10 Thread Carlo Arenas
On Sat, Aug 10, 2019 at 3:17 PM Daniel Stenberg wrote: > > On Sat, 10 Aug 2019, Carlo Marcelo Arenas Belón wrote: > > > 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). > > Let me ju

Re: [RFC PATCH] http: use xmalloc with cURL

2019-08-10 Thread Daniel Stenberg
On Sat, 10 Aug 2019, Carlo Marcelo Arenas Belón wrote: 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). Let me just gently point out that 7.12.0 was relased mid *2004*, see https://curl