[Gc] Re: Partially scanning a VM's call stack

Ludovic Courtès ludo at gnu.org
Wed Aug 19 03:09:56 PDT 2009


Ivan Maidanski <ivmai at mail.ru> writes:

> Do you know the VM stack direction?

It grows up (towards higher addresses).

> Typically most stacks grow down, but if this is an outstanding case
> then: Allocate the VM thead stack using
> GC_GCJ_MALLOC(sizeof(word)+stack_size, &descr), where descr is of type
> struct { some_word; word stack_top; }, where stack_top is adjusted on
> every push/pop (initially stack_top = sizeof(word) | GC_DS_LENGTH,
> i.e. stack is empty).

This looks like the easiest solution.  OTOH `GC_gcj_malloc ()' appears
to be undocumented, so I'd rather go for GC_new_kind + GC_MAKE_PROC.


More information about the Gc mailing list