]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add note about the timing of recording an mremap event.
authorDJ Delorie <dj@delorie.com>
Thu, 21 Jul 2016 01:18:10 +0000 (21:18 -0400)
committerDJ Delorie <dj@delorie.com>
Thu, 21 Jul 2016 01:18:10 +0000 (21:18 -0400)
malloc/malloc.c

index bc3f11740c82ca4095ae46ec082eedc505f9b073..975373117414f577769a7c98f91eaaf6fec9b246 100644 (file)
@@ -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)
        {