[PATCH v4] benchtest: malloc tcache hotpath benchtest.

Cupertino Miranda cupertino.miranda@oracle.com
Wed May 14 09:35:04 GMT 2025


Hi Wilco,

>> I updated to GCC 15.1 and I don't seem to be able to reproduce > the error you mentioned.
>>
>> How did you get it?
> 
> I was using GCC 14, however GCC 15 shows the same error:
> 
> In file included from bench-calloc-tcache.c:22:
> bench-malloc-tcache.c: In function ‘do_benchmark’:
> bench-malloc-tcache.c:96:12: error: pointer ‘elem’ used after ‘free’ [-Werror=use-after-free]
>     96 |   *iters = malloc_benchmark_loop (elem);
>        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> bench-malloc-tcache.c:93:3: note: call to ‘free’ here
>     93 |   free (elem);
>        |   ^~~~~~~~~~~
I changed that code, so it explains it.

I thought in the original message you were suggesting the error would 
come from (code below), which would be a really strange error:

+  TIMING_NOW (start);
+  *iters = malloc_benchmark_loop (elem);
+  TIMING_NOW (stop);

Will send a new version of the benchmark today.

Cheers,
Cupertino


More information about the Libc-alpha mailing list