aboutsummaryrefslogtreecommitdiff
path: root/malloc/malloc.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2016-07-20 21:18:10 -0400
committerDJ Delorie <dj@delorie.com>2016-07-20 21:18:10 -0400
commit9c879c0b3140f891ac783e009d49ff8a907fcb9a (patch)
tree030daebb00fe84e626d5892f0806e0c59397c371 /malloc/malloc.c
parentf214e7297413a27c5809d5f04a296e2104df1f8f (diff)
downloadglibc-9c879c0b3140f891ac783e009d49ff8a907fcb9a.tar.xz
glibc-9c879c0b3140f891ac783e009d49ff8a907fcb9a.zip
Add note about the timing of recording an mremap event.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r--malloc/malloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index bc3f11740c..9753731174 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)
{