[musl] Re: realloci(): A realloc() variant that works in-place

Thorsten Glaser tg@mirbsd.de
Fri Oct 31 15:45:09 GMT 2025


On Fri, 31 Oct 2025, Alejandro Colomar wrote:

>In C, I've sometimes seen programmers trying to check if realloc(3)
>moved or not, to skip some work.  That's a micro-optimization that I've
>never written myself, so I won't defend it.  But for some reason, some
>programmers keep wanting to do it.

Huh. That one if is probably more effort than just doing the
arithmetics always… if it’s not actually UB…

We don’t always need to follow what “some programmers keep
wanting to do” ☻

bye,
//mirabilos
-- 
<igli> exceptions: a truly awful implementation of quite a nice idea.
<igli> just about the worst way you could do something like that, afaic.
<igli> it's like anti-design.  <mirabilos> that too… may I quote you on that?
<igli> sure, tho i doubt anyone will listen ;)


More information about the Libc-alpha mailing list