Okay, now that we're getting more into extensions and NCI access, we need to add an extra array to the root set of the interpreter. The purpose of this array is to root PMCs that are passed into external libraries and may not be in any of the current root set members (the stacks, registers, system stack, and namespaces hanging off the interpreter). This thing is the "External PMC Registry", and it's fine for it to be a plain array.

We need to add two ops:

  register Px
  unregister Px

which add and remove one reference to whatever PMC is in Px to the registry. (A PMC may be in the registry multiple times, and if so each unregister removes *one* reference)

The extension interface also needs two function entry points:

  Parrot_register_pmc(interpreter, pmc)
  Parrot_unregister_pmc(interpreter, pmc)

so that extension code can do this.

It's fine for this to be a simple array for now. I realize that means O(n) access times, but we can always upgrade it to something with faster access times later--this is enough to get us going.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to