alx-0029r6 - Restore the traditional realloc(3) specification

H. Peter Anvin hpa@zytor.com
Sun Jun 29 16:25:13 GMT 2025


On 2025-06-27 07:01, Alejandro Colomar wrote:
> Hi!
> 
> Here's a new revision of the proposal, addressing some points raised by
> Mark, plus clarifying that the paragraph about when size is zero refers
> to the total size, as Florian was concerned that it might not be
> symmetric.
> 

I don't know if it would be useful, but proposing a new interface of the 
form:

	reallocp(&ptr, size)

... to separate the status return from the pointer might be a really 
good idea.  This would hopefully eliminate users doing the "obvious":

	ptr = realloc(ptr, size)

Not that this resolves anything in the short or even medium term, but 
perhaps can help avoid problems in the more distant time frame.  It is 
also an interface which is mostly trivial to infill.

	-hpa



More information about the Libc-alpha mailing list