Dan Sugalski <[EMAIL PROTECTED]> wrote: > Next, the sequence of loading.
> Right now there's a load_pmc op Gone. > and loadlib ops. I'd like to unify that Done. > When we load a library, the bytecode should probe for and, if it exists, > call Parrot_lib_load_%s, where %s is the library name. If it doesn't exist, it assumes a native library, this is what the sequence loadlib / dlfunc is expecting, --done ... > , the interpreter, and returns a PMC representing the library > that we can query later. ... until here. What kind of PMC is e.g a PMC-library intended to return? As it seems, that the Parrot_lib_init_%s code is called again on interpreter forking, the PMC has to hold the library handle. Now, when Parrot_lib_load_%s should construct the PMC, it can't place the handle into the PMC. Of course, the dynext.c:Parrot_load_lib() could stuff the handle into the PMC, if the returned PMC is appropriate for that. I have an optional (currently unused, NULL) 3rd argument to Parrot_load_lib, which could be an initializer, if needed, so that loadlib P1, "the_lib", P2 would be possible too. > Dan leo