I'm porting an imprecise garbage collector from Windows to MacOS X. In it, it has to scan the stack to identify potential pointers into the heap, and then use those as GC roots. To do this, I need the stack's base as well as it's length. In Windows, this code uses an algorithm similar to what's described here:
http://stackoverflow.com/questions/3171475/stack-and-stack-base-address
How do I do that on Mac OS X? Note that, for now, I only care about the main thread. The interpreter that uses this GC is single threaded and I can guarantee that no references exist on other threads./