1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Remove unused scratch_buffer_dupfree

Turns out scratch_buffer_dupfree internal API was unused since

commit ef0700004b
stdlib: Simplify buffer management in canonicalize

And the related test in malloc/tst-scratch_buffer had issues
so it's better to remove it completely.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Szabolcs Nagy
2022-10-11 13:23:25 +01:00
parent 2eeeee7636
commit 8c77e26ba8
5 changed files with 0 additions and 79 deletions

View File

@ -151,26 +151,6 @@ do_test (void)
&& array_size_must_fail (4, ((size_t)-1) / 4)))
return 1;
}
{
struct scratch_buffer buf;
scratch_buffer_init (&buf);
memset (buf.data, '@', buf.length);
size_t sizes[] = { 16, buf.length, buf.length + 16 };
for (int i = 0; i < array_length (sizes); i++)
{
/* The extra size is unitialized through realloc. */
size_t l = sizes[i] > buf.length ? sizes[i] : buf.length;
void *r = scratch_buffer_dupfree (&buf, l);
void *c = xmalloc (l);
memset (c, '@', l);
TEST_COMPARE_BLOB (r, l, buf.data, l);
free (r);
free (c);
}
scratch_buffer_free (&buf);
}
return 0;
}