Thread (1 message) 1 message, 1 author, 2021-12-18

Re: [PATCH v6 1/6] object-file.c: release strbuf in write_loose_object()

From: Junio C Hamano <hidden>
Date: 2021-12-18 00:09:35

René Scharfe [off-list ref] writes:
There was no leak before.  Both strbufs are static and both functions
they are passed to (loose_object_path() and create_tmpfile()) reset
them first.  So while the allocated memory was not released before,
it was reused.

Not sure if making write_loose_object() allocate and release these
buffers on every call has much of a performance impact.  The only
reason I can think of for wanting such a change is to get rid of the
static buffers, to allow the function to be used by concurrent
threads.

So I think either keeping the code as-is or also making the strbufs
non-static would be better (but then discussing a possible
performance impact in the commit message would be nice).
Makes sense.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help