]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc: Remove do_check_remalloced_chunk
authorDev Jain <dev.jain@arm.com>
Wed, 10 Dec 2025 15:00:18 +0000 (15:00 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Wed, 17 Dec 2025 15:32:53 +0000 (15:32 +0000)
do_check_remalloced_chunk checks properties of fastbin chunks. But, it is also
used to check properties of other chunks. Hence, remove this and merge the body
of the function in do_check_malloced_chunk.

Reviewed-by: DJ Delorie <dj@redhat.com>
malloc/malloc.c

index f72262ed03adf3c248fb0a84b89a80032ebb98d5..1fc25a69c87f3905f05e5398c6e7decf95b3c21f 100644 (file)
@@ -2065,7 +2065,6 @@ madvise_thp (void *p, INTERNAL_SIZE_T size)
 # define check_chunk(A, P)
 # define check_free_chunk(A, P)
 # define check_inuse_chunk(A, P)
-# define check_remalloced_chunk(A, P, N)
 # define check_malloced_chunk(A, P, N)
 # define check_malloc_state(A)
 
@@ -2074,7 +2073,6 @@ madvise_thp (void *p, INTERNAL_SIZE_T size)
 # define check_chunk(A, P)              do_check_chunk (A, P)
 # define check_free_chunk(A, P)         do_check_free_chunk (A, P)
 # define check_inuse_chunk(A, P)        do_check_inuse_chunk (A, P)
-# define check_remalloced_chunk(A, P, N) do_check_remalloced_chunk (A, P, N)
 # define check_malloced_chunk(A, P, N)   do_check_malloced_chunk (A, P, N)
 # define check_malloc_state(A)         do_check_malloc_state (A)
 
@@ -2195,11 +2193,11 @@ do_check_inuse_chunk (mstate av, mchunkptr p)
 }
 
 /*
-   Properties of chunks recycled from fastbins
+   Properties of chunks at the point they are malloced
  */
 
 static void
-do_check_remalloced_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T s)
+do_check_malloced_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T s)
 {
   INTERNAL_SIZE_T sz = chunksize_nomask (p) & ~(PREV_INUSE | NON_MAIN_ARENA);
 
@@ -2222,17 +2220,6 @@ do_check_remalloced_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T s)
   /* chunk is less than MINSIZE more than request */
   assert ((long) (sz) - (long) (s) >= 0);
   assert ((long) (sz) - (long) (s + MINSIZE) < 0);
-}
-
-/*
-   Properties of nonrecycled chunks at the point they are malloced
- */
-
-static void
-do_check_malloced_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T s)
-{
-  /* same as recycled case ... */
-  do_check_remalloced_chunk (av, p, s);
 
   /*
      ... plus,  must obey implementation invariant that prev_inuse is