]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Revert "Use _int_free_chunk in tcache_thread_shutdown"
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 4 Aug 2025 17:31:49 +0000 (17:31 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 4 Aug 2025 17:31:49 +0000 (17:31 +0000)
This reverts commit 05ef6a49746faedb4262db1476449c1c2c822e95.

malloc/malloc.c

index 9a5c9a9de2c73064c3a70d64bf461cb182712b37..3a8aaeb665cc5d5027a82ef50e34af229d3321b4 100644 (file)
@@ -3288,7 +3288,6 @@ static void
 tcache_thread_shutdown (void)
 {
   int i;
-  mchunkptr p;
   tcache_perthread_struct *tcache_tmp = tcache;
 
   tcache_shutting_down = true;
@@ -3310,14 +3309,11 @@ tcache_thread_shutdown (void)
            malloc_printerr ("tcache_thread_shutdown(): "
                             "unaligned tcache chunk detected");
          tcache_tmp->entries[i] = REVEAL_PTR (e->next);
-         e->key = 0;
-         p = mem2chunk (e);
-         _int_free_chunk (arena_for_chunk (p), p, chunksize (p), 0);
+         __libc_free (e);
        }
     }
 
-  p = mem2chunk (tcache_tmp);
-  _int_free_chunk (arena_for_chunk (p), p, chunksize (p), 0);
+  __libc_free (tcache_tmp);
 }
 
 /* Initialize tcache.  In the rare case there isn't any memory available,