> On Dec 17, 2018, at 2:23 PM, Szabolcs Nagy <szabolcs.n...@arm.com> wrote:
> 
> On 17/12/2018 18:22, Uecker, Martin wrote:
>>> 
>>> ...
>> 
>> So a thread_local static variable for storing the static
>> chain?
> 
> something like that, but the more i think about it the
> harder it seems: the call site of the nested function
> may not be under control of the nested function writer,
> in particular the nested function may be called on a
> different thread, and extern library apis are unlikely
> to provide guarantees about this, so in general if a
> nested function escapes into an extern library then
> this cannot be relied on, which limits my original
> idea again to cases where there is no escape (which i
> think is not that useful).

I'm not sure I understand "escape" of a nested function pointer. 

Your description makes it sound like you're talking about a function being 
called by someone who has been given the pointer, from outside the scope of the 
function.  That sounds like an illegal operation, exactly as it would be if you 
attempted to reference an automatic variable via a pointer from outside the 
scope of that variable.

Did I misunderstand?

        paul

Reply via email to