[libcxx-commits] [libcxx] [libc++] Provide sized deallocation declarations even when the compiler doesn't support sized deallocation (PR #125577)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 5 06:18:24 PST 2025


ldionne wrote:

> I don't think that's the problem. The sized overload just calls the unsized one by default, so I don't see how that's breaking. My understanding is that the fundamental is that the compiler silently changes to generating calls to functions which may not exist in the runtime yet. That could probably have been solved by using availability information, but most platforms don't have that.

I think you're correct about this. I did some more archeology and that (missing symbols in most existing libraries) seems to be the reason why `-fsized-deallocation` wasn't made default for so long. And since the sized `operator delete` does call the normal `operator delete`, you're also correct that there shouldn't be a backwards compatibility issue here. The situation we're running into downstream probably calls for a different solution.

> Do you mean we'd have them if there are back-deployment problems? Because I can't find any.

Ah, you're right here too, I wrongly assumed there were availability attributes. That looks like an oversight, since availability attributes are definitely the way we'd normally catch these kinds of issues.

Either way, I think I'm convinced that the current code is the way it should be, so I'll close this. Thanks for the discussion. We will pursue another direction for the downstream issues we saw related to this.

https://github.com/llvm/llvm-project/pull/125577


More information about the libcxx-commits mailing list