Thread (1 message) 1 message, 1 author, 2016-06-16

Re: [PATCH 49/83] builtin/apply: move 'lock_file' global into 'struct apply_state'

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:04

Christian Couder [off-list ref] writes:
quoted
I do not think you need to think about "free"ing.
Yeah, lockfile.h says:
...
and:
...
Yup, we are now on the same page.
quoted
Even if the libified version of the apply internal can be called
multiple times to process multiple patch inputs, there is no need to
run multiple instances of it yet.  And a lockfile, after the caller
finishes interacting with one file using it by calling commit or
rollback, can be reused to interact with another file.
lockfile.h says this about the above paragraph, which is a more
important part ;-)

 * When finished writing, the caller can:
 * ...
 * Even after the lockfile is committed or rolled back, the
 * `lock_file` object must not be freed or altered by the caller.
 * However, it may be reused; just pass it to another call of
 * `hold_lock_file_for_update()`.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help