[musl] Re: realloci(): A realloc() variant that works in-place
Thiago Macieira
thiago@macieira.org
Sat Nov 1 15:11:50 GMT 2025
On Saturday, 1 November 2025 05:57:56 Pacific Daylight Time Florian Weimer
wrote:
> This would not help C++ because C++ doesn't have this kind of in-place
> adjust-all-pointers operation. There's just copy and move, and both
> need non-overlapping old and new storage at the same time.
Indeed. It's not unprecedented: we are discussing adding an extension point
for the non-trivial relocation operation (that is, for those class types that
need an out-of-line, complex operation to atomically move the contents from
source to destination and destroy the source).
However, this is yet another extension point because it doesn't obviate the
need for the above. I don't think it will happen because of the complexity of
the task and how few developers will get it right. And that's in addition to
the update to the core language rules on pointer arithmetic.
That's why I said I don't oppose this change to the pointer rules in
principle, only if it is done *instead of* realloci().
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Principal Engineer - Intel Data Center - Platform & Sys. Eng.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 870 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20251101/f733dbcd/attachment.sig>
More information about the Libc-alpha
mailing list