I think Thiago was referring to storing thread-local variables for reentrant intercepted function calls.
 

-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mo 29.07.2024 18:18
Betreff: Re: [std-proposals] Interceptor Function (preserve stack and all registers)
An: std-proposals@lists.isocpp.org;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;


On Monday, July 29, 2024, Thiago Macieira wrote:

I was hasty in my reply, because you need to store at least one thing to make
it work: the return address you replaced with yours. You can't keep it r10
because it's a volatile register. You can't use the stack because you have
none available. You have to use a thread-local variable and to make that
reentrant, you'd need to have a linked list of return addresses allocated
using the heap. So it's possible... just terribly cumbersome.
 
 
 
I don't know where you're going with your linked list. If you look at the GodBolt I gave you, you'll see I have it working on x86_32 with one simple thread-local variable.
 
Ain't no linked lists round these parts.