On Tue, 5 Aug 2003 17:59:36 +0200 Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> Dan Sugalski <[EMAIL PROTECTED]> wrote: > > At 11:10 +0200 7/31/03, Leopold Toetsch wrote: > >> > *) Determine the init and setup routine names > >> > >>- Parrot_<classname>_class_setup > >>- Parrot_<classname>_class_init > >> > >>The class_setup also sets the class_enum i.e vtable->base_type. > > > Well... there are versioning issues there. We ought to be able to > > have multiple versions of a class loaded, in which case this may not > > work. I'm pretty sure that there are some platforms that require > > unique names in libraries across the entire process. > > What about the following (also considering, that we might not like one > handle/mmap... per PMC, as stated in one f'up): > > A dynamic PMC library has one init function returning a dyn_pmc_info > structure: Why not do it (more or less) the way Perl5 does it? Have a "load_and_init" operation which loads a dynamic library and calls some predefined function in it (just pick a name). That function can then register new PMCs, opcodes, events, whatever you like using normal Parrot_* API functions. This can be made to be exactly as efficient as your proposal, and I think it is more flexible. Regards Mattia