From 711ee6a7112e041978a5af99c8cd6d95d63a30eb Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Fri, 3 Apr 2026 17:02:08 +0200 Subject: [PATCH] * src/igc.c (igc_xnrealloc_ambig): Deleted because it was unused. --- src/igc.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/igc.c b/src/igc.c index 6e2472b8eb3..ecd9c325d7b 100644 --- a/src/igc.c +++ b/src/igc.c @@ -4210,31 +4210,6 @@ igc_xpalloc_exact (void **pa_cell, ptrdiff_t *nitems, igc_xfree (old_pa); } -static void * -igc_xnrealloc_ambig (void *old_pa, ptrdiff_t nitems, ptrdiff_t item_size) -{ - ptrdiff_t old_nbytes = 0; - if (old_pa != NULL) - { - struct igc_root_list *r = root_find (old_pa); - igc_assert (r); - eassume (r != NULL); - old_nbytes = (char *) r->d.end - (char *) r->d.start; - } - ptrdiff_t nbytes; - if (ckd_mul (&nbytes, nitems, item_size) || SIZE_MAX < nbytes) - memory_full (SIZE_MAX); - void *new_pa = xzalloc (nbytes); - char *end = (char *) new_pa + nbytes; - root_create_ambig (global_igc, new_pa, end, "xnrealloc-ambig"); - ptrdiff_t min_nbytes = min (old_nbytes, nbytes); - memcpy (new_pa, old_pa, min_nbytes); - eassert (memcmp (new_pa, old_pa, min_nbytes) == 0); - igc_xfree (old_pa); - - return new_pa; -} - void * igc_xpalloc_raw_exact (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min, ptrdiff_t nitems_max,