Am Mittwoch, 13. Juni 2007 05:02 schrieb chromatic: > PMC * const key = VTABLE_nextkey_keyed(interp, key_new(interp), > ns, ITERATE_FROM_START); > > If a GC run happens in the rest of this function, it could collect the > newly created Key -- PMCs created and held outside of structures visible to > GC are vulnerable to collection.
This really shouldn't happen. All GC runs that are done due to lack of some ressource are walking the C-stack and the CPU registers I hope[1]. GC runs initiated at the run-loop level don't need this BTW. [1] the real problem might be that on MS the marking of the CPU-registers isn't happening. See also trace_system_areas() in src/cpu_dep.c and e.g. ... # ifdef PARROT_HAS_HEADER_SETJMP Parrot_jump_buff env; /* Zero the Parrot_jump_buff, otherwise you will trace stale objects */ memset(&env, 0, sizeof (env)); /* this should put registers in env, which then get marked in * trace_system_stack below */ setjmp(env); # endif ... how to use a standard C lib function to force CPU registers onto the stack. Other methods for other CPUs are present in that file too. leo