[webkit-dev] Stuck... again (Conserative GC)

Darin Adler darin at apple.com
Sun Jun 12 01:56:56 PDT 2005


On Jun 11, 2005, at 3:16 PM, Justin Haygood wrote:

> the Win32 API simply does not allow getting the base stack address  
> of a thread, because:
>
> 1. not stable.. Windows WILL and DOES move that base address at will.
> 2. Its exclusively chosen and managed by Windows itself.. no ands,  
> buts, or ors about it.
>
> In fact, the only way to get it is via the IoGetInitialStack();  
> function, which isn't calleable by user space functions (its a  
> kernel driver function, only defined in ntddk.h, and last time i  
> checked, we don't want a browser running in kernel-space.
>
> What would be an alternative way to implement a conservative GC  
> that I can use?

To do the garbage collection we need to be able to walk all the  
addresses on the stack at one particular point in time.

The base address moving should not be an obstacle; it doesn't matter  
what it was in the past or what it will be in the future. All that  
matters is what the base is right at the moment garbage collection is  
occurring. On the other hand, I'm not even sure what it means to move  
the stack's base address.

The base address being chosen and managed by Windows doesn't sound  
like an obstacle either. That's equally true on the Mac OS X platform  
and other Unix platforms. Of course the OS chooses the base address  
for the stack -- that's normal.

Walking the stack is definitely possible on Windows. Keep trying and  
I'm sure you can find out how. I'm sorry this is proving so difficult  
to research.

     -- Darin




More information about the webkit-dev mailing list