C++ Logo

std-proposals

Advanced search

Re: [std-proposals] set_new_handler extension

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Sun, 12 Feb 2023 18:05:54 +0100
On 12/02/2023 17.54, Thiago Macieira via Std-Proposals wrote:
> On Sunday, 12 February 2023 08:41:21 PST Jens Maurer via Std-Proposals wrote:
>> That's already the specified behavior when you provide your own
>> definition of global "operator new" and global "operator delete":
>> You replace those functions program-wide.
>>
>> The implementation you use may behave differently when DLLs
>> are involved; please discuss this with your implementer.
>
> It does and that cannot be changed on Windows without a major overhaul of just
> how the "dynamic linking" part of "dynamic linking libraries" work. In other
> words, this is not just a (compile-time) linker problem, it's mostly a program
> loader and file format problem.
>
> Even macOS/Darwin adopted some of the characteristics that are problematic, so
> I don't know how well it works on those OS and, if it does work, just how.

That may or may not be a desirable state for such implementations to be in,
but I can't see how adding a feature to the standard that it already offers
would help the situation in any way.

In general, doing the same thing two different ways seems to require
extensive rationale.

Jens

Received on 2023-02-12 17:06:07