Arthur Bergman wrote:

On 2 May 2004, at 12:37, Leopold Toetsch wrote:

Can't you call that somewhere in an outer frame? E.g. where you create
the interpreter.

No, because I might be creating the interpreter in a callback from the application, and then access that interpreter in ANOTHER callback from the application.

Your are speaking of a usage like "perldoc perlembed" here, I presume. For old code that is totally unaware that its running on Parrot, you'll have to anchor (dod_register) returned PMCs. dodregister() works like REFCNT_inc(), i.e. you can register a PMC multiple times. unregister is like REFCNT_dec(), except there is no immediate destruction if the register count reaches zero.


Such an embeded usage might also need a flag for entering the run loop, so that the stack top is always set at the run loop stack frame.

Arthur

leo



Reply via email to