Thanks for the quick reply! Yes, that would be wonderful. I want to interface to a library that has its own garbage collection; that library walks the stack to find potential objects that must be kept alive. Therefore, all calls to that library must be done in the form library_global_StackBottomBags = __builtin_frame_address(0); library_function(...)
On Thursday, 31 March 2016 00:25:13 UTC+2, Yichao Yu wrote: > > > On Mar 30, 2016 6:22 PM, "Yichao Yu" <yyc...@gmail.com <javascript:>> > wrote: > > > > > > On Mar 30, 2016 6:21 PM, "Laurent Bartholdi" <laurent....@gmail.com > <javascript:>> wrote: > > > > > > Hi, > > > Is there a way to obtain the address of the current stack frame (the > ebp register on x86 processors)? > > > > > > In GCC, there's the bultin primitive __builtin_frame_address() that > does precisely that. > > > > Why do you want this? > > > > It's possible but should not be done in general. > > > > > > > Many thanks in advance, Laurent >