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

Re: [PATCH] Make xmalloc and xrealloc thread-safe

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:29

Nicolas Pitre [off-list ref] writes:
On Wed, 24 Mar 2010, Shawn O. Pearce wrote:
quoted
Nicolas Pitre [off-list ref] wrote:
quoted
Note: there was a dubious usage of fd when calling release_pack_memory() 
in xmmap() which is now removed.
...
quoted
@@ -100,7 +112,7 @@ void *xmmap(void *start, size_t length,
 	if (ret == MAP_FAILED) {
 		if (!length)
 			return NULL;
-		release_pack_memory(length, fd);
+		try_to_free_routine(length);
This isn't dubious!  The fd passed here is to prevent the pack
release code from closing this fd right before we try to mmap it.
Its an actual bug fix that I had to write years ago, check the
history of that section of code...  :-)
Argh.  My bad.  I somehow thought that fd was the actual pack to free 
when specified.  Let's drop the very last hunk of the patch then.  
xmmap() is certainly not going to be invoked concurrently to the rest of 
sha1_file.c in a separate thread.

Junio: I suppose you don't need me to resend?
Will just drop the last hunk.  Thanks, both.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help