git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Carlo Arenas <carenas@gmail.com>
Date
Aug 11, 2019, 19:08 UTC
Message-ID
<CAPUEspg62pRNH6=_VvWDxQ4YujHUJAoTTampc0L4t68QMj30xg@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1908111317540.46@tvgsbejvaqbjf.bet>

On Sun, Aug 11, 2019 at 4:20 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 5 quoted lines
> 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 have to fix the #ifdef so there is no risky of breaking someone's build because they happen to still be using and old enough cURL (ex: 7.10)

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 first #ifdef NED (I promise to take it out before it even gets to next, assuming Junio would trust me enough after the last blow up to even get it into pu)

alternatively, getting some feedback from people that know that code better like Shawn, since I have to admit I haven't read it enough to be fully confident it is safe (although I believe it was enough, or I wouldn't had sent it for feedback otherwise)

> Please note that this did not cause problems in Git for Windows.
> Probably because we leave it to cURL to deallocate whatever it
> allocated.
unlike PCRE2 there is no layering violation to trigger
> Still, it is a good idea to ask libcurl to use the same allocator as Git.

and it should have a positive performance impact, which should be nice to look for.

Carlo
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 11 in “http: use xmalloc with cURL”
  1. http: use xmalloc with cURLCarlo Marcelo Arenas Belón, Aug 10, 2019
  2. Daniel StenbergAug 10, 2019
  3. Carlo ArenasAug 10, 2019
  4. Johannes SchindelinAug 11, 2019
  5. Carlo ArenasAug 11, 2019
  6. Johannes SchindelinAug 12, 2019
  7. Jeff KingAug 12, 2019
  8. Junio C HamanoAug 12, 2019
  9. Jeff KingAug 12, 2019
  10. Johannes SchindelinAug 13, 2019
  11. Jeff KingAug 14, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.