https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106477

--- Comment #6 from Matthijs Kooijman <matthijs at stdin dot nl> ---
Ah, IIUC your patch does not treat -fno-exceptions specially, but just adds a
shortcut for the nothrow new version to skip calling regular new version if it
has not been replaced. In a normal build, that saves throw/catch overhead, and
in a no-exceptions build that prevents the abort associated with that throw.
Clever!

One corner case seems to be when the regular new version is replaced in a
no-exceptions build, but in that case that replacement has no way to signal
failure anyway, and if needed a user can just also replace the nothrow version.

I can't comment on the details of the patch wrt aliases and preprocessor stuff,
but the approach and the gist of the code looks ok to me.

Reply via email to