From 9c879c0b3140f891ac783e009d49ff8a907fcb9a Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Wed, 20 Jul 2016 21:18:10 -0400 Subject: [PATCH] Add note about the timing of recording an mremap event. --- malloc/malloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/malloc/malloc.c b/malloc/malloc.c index bc3f11740c8..97537311741 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3736,6 +3736,13 @@ __libc_realloc (void *oldmem, size_t bytes) void *newmem; #if HAVE_MREMAP + /* There is no time when we own both the old and new pointers + here, so we have no choice but to record the trace event in a + way that might lead to an inversion. This is a rare enough + case that a double inversion is too likely to worry about, + and the trace converter can fix a lone single inversion. We + choose to record it inside the 'if' because it's convient to + us. */ newp = mremap_chunk (oldp, nb); if (newp) { -- 2.47.2