emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b7dfd39 2/2: Remove malloc_find_address relic


From: Paul Eggert
Subject: [Emacs-diffs] master b7dfd39 2/2: Remove malloc_find_address relic
Date: Wed, 21 Jun 2017 15:19:02 -0400 (EDT)

branch: master
commit b7dfd39c8b2ebd127e83d84b9df48be173bc0134
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Remove malloc_find_address relic
    
    * src/gmalloc.c (register_heapinfo, _malloc_internal_nolock):
    Omit unnecessary initialization.
---
 src/gmalloc.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/gmalloc.c b/src/gmalloc.c
index 103c191..baaff58 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -144,8 +144,7 @@ typedef union
                size_t first; /* First free fragment of the block.  */
              } frag;
            /* For a large object, in its first block, this has the number
-              of blocks in the object.  In the other blocks, this has a
-              negative number which says how far back the first block is.  */
+              of blocks in the object.  */
            ptrdiff_t size;
          } info;
       } busy;
@@ -493,9 +492,6 @@ register_heapinfo (void)
   /* Describe the heapinfo block itself in the heapinfo.  */
   _heapinfo[block].busy.type = -1;
   _heapinfo[block].busy.info.size = blocks;
-  /* Leave back-pointers for malloc_find_address.  */
-  while (--blocks > 0)
-    _heapinfo[block + blocks].busy.info.size = -blocks;
 }
 
 #ifdef USE_PTHREAD
@@ -887,12 +883,6 @@ _malloc_internal_nolock (size_t size)
       ++_chunks_used;
       _bytes_used += blocks * BLOCKSIZE;
       _bytes_free -= blocks * BLOCKSIZE;
-
-      /* Mark all the blocks of the object just allocated except for the
-        first with a negative number so you can find the first block by
-        adding that adjustment.  */
-      while (--blocks > 0)
-       _heapinfo[block + blocks].busy.info.size = -blocks;
     }
 
   PROTECT_MALLOC_STATE (1);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]