| 
  | 
Message-ID: <9ce5fc2a-fc8d-4f84-8d69-9ea37cefc356@cs.ucla.edu> Date: Fri, 31 Oct 2025 14:33:22 -0600 From: Paul Eggert <eggert@...ucla.edu> To: Alejandro Colomar <alx@...nel.org> Cc: libc-alpha@...rceware.org, musl@...ts.openwall.com, "A. Wilcox" <AWilcox@...cox-tech.com>, Lénárd Szolnoki <cpp@...ardszolnoki.com>, Collin Funk <collin.funk1@...il.com>, Arthur O'Dwyer <arthur.j.odwyer@...il.com>, Jonathan Wakely <jwakely@...hat.com>, "Paul E. McKenney" <paulmck@...nel.org>, Thiago Macieira <thiago@...ieira.org> Subject: Re: Re: realloci(): A realloc() variant that works in-place On 10/31/25 14:13, Alejandro Colomar wrote: > Consider that realloci() would be significantly cheaper than realloc(3), Not in the case where the object doesn't move: they should be about the same speed. And when the object grows so much that it does need to move, the V7 realloc approach should be a bit faster because you need to make just one call into the memory subsystem, not three (realloci + malloc + free). > That would make sanitizers and static analyzers unable to verify lots of > code No, just the opposite. Currently sanitizers etc. spend useless work checking for C23 rules that don't correspond to any hardware or correctness needs; they're simply rules imposed by the C committee. This checking is counterproductive to real-world software development. If we fixed the realloc spec to better match how actual production hardware behaves, we could fix sanitizers to spend their time flagging real bugs instead of wasting their time (and developers' time) generating false alarms. > I wouldn't categorize it as hard to explain: Oh, it's not hard to specify a realloci API, or to implement it. What's hard is explaining its motivation: why it's needed and what it's good for. It's motivated by specialized applications that most programmers don't know about and don't need to. And these specialized applications would be better served by a 7th Edition Unix realloc.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.