Request for feedback on WG14 proposal N3849 (alloc_at_least)
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Thu Apr 23 21:45:32 GMT 2026
Hi Paul,
> Sure, but I was wondering not about microbenchmarks, but about realistic
> applications. That's a key point in determining the cost/benefit
> tradeoff for this proposal.
My result implies you can't measure a few extra calls to realloc unless you are
doing millions every second.
> Clearly the main motivation for the proposal is performance, as realloc
> already provides the functionality needed for correctness. So, what
> performance costs and benefits would typical glibc-using apps see?
> That's not clear from the proposal.
I agree it's not clearly stated, but only the first case seems to be performance
related. The others talk about saving memory in bump allocators. This kind of
allocator uses relatively large blocks, so the wastage would be a small percentage,
and wouldn't affect performance.
In general choosing a size that minimizes such wastage is easy. However you
could use malloc_usable_size since its cost would be small compared to the
overhead of mmap.
Cheers,
Wilco
More information about the Libc-alpha
mailing list