C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Interceptor Function (preserve stack and all registers)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 13 Apr 2026 07:52:32 -0700
On Monday, 13 April 2026 05:50:46 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> As I said though, I don't want to code this 6 ways for 6 different
> architectures, and so even if we can get "__thiscall" to work for
> x86_32, maybe other architectures won't make it so easy to place the
> first argument into a register rather than on the stack. For this
> reason, maybe the best solution is the first solution I posted above,
> the one which wraps everything inside a lambda so that a destructor
> won't be able to overwrite the scratch register.

Since this can only aspire to become a compiler extension, it doesn't need to
work everywhere. It just needs to work where you need it to work.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-04-13 14:52:43