On 09/11/2020 2:58 PM, Ali Çehreli wrote:
Does the D GC know the complete function call stack of the C program all the way up from 'main'? Is there the concept of "bottom of the stack" or does the D GC can only know the value of the stack pointer at the time rt_init() was called. If the latter, then I think a toStringz string may not be alive in a C function.

https://github.com/dlang/druntime/blob/master/src/core/thread/context.d#L16
https://github.com/dlang/druntime/blob/master/src/core/thread/threadbase.d#L469
https://github.com/dlang/druntime/blob/master/src/core/thread/osthread.d#L1455
https://github.com/dlang/druntime/blob/master/src/core/thread/osthread.d#L1208

I'm tired, so here is the code related to your questions.

Note: the GC will use this abstraction for dealing with stack frames (otherwise it would be duplicated).

Reply via email to