aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilco Dijkstra <wilco.dijkstra@arm.com>2025-04-03 14:24:22 +0000
committerWilco Dijkstra <wilco.dijkstra@arm.com>2025-08-04 17:13:55 +0000
commit05ef6a49746faedb4262db1476449c1c2c822e95 (patch)
tree78be23b3ebb5483adb100741f638247c371280df
parent8f57caa7fdcb7ab3016897a056ccf386061e7734 (diff)
downloadglibc-05ef6a49746faedb4262db1476449c1c2c822e95.zip
glibc-05ef6a49746faedb4262db1476449c1c2c822e95.tar.gz
glibc-05ef6a49746faedb4262db1476449c1c2c822e95.tar.bz2
Use _int_free_chunk in tcache_thread_shutdown
-rw-r--r--malloc/malloc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 151e6c6..2ac5625 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3293,6 +3293,7 @@ static void
tcache_thread_shutdown (void)
{
int i;
+ mchunkptr p;
tcache_perthread_struct *tcache_tmp = tcache;
tcache_shutting_down = true;
@@ -3314,11 +3315,14 @@ tcache_thread_shutdown (void)
malloc_printerr ("tcache_thread_shutdown(): "
"unaligned tcache chunk detected");
tcache_tmp->entries[i] = REVEAL_PTR (e->next);
- __libc_free (e);
+ e->key = 0;
+ p = mem2chunk (e);
+ _int_free_chunk (arena_for_chunk (p), p, chunksize (p), 0);
}
}
- __libc_free (tcache_tmp);
+ p = mem2chunk (tcache_tmp);
+ _int_free_chunk (arena_for_chunk (p), p, chunksize (p), 0);
}
/* Initialize tcache. In the rare case there isn't any memory available,