Macintosh Advice Sought: Squeak VM as NS Plugin

Lawson English english at primenet.com
Sun Feb 6 22:45:28 UTC 2000


On Sat, Feb 5, 2000 2:46 PM, Raab, Andreas <Andreas.Raab at disney.com> wrote:
>Bob,
>
>> I don't know the answer, but your question leads me to wonder:
>> 
>> 1. Can you successfully use fragments that are *not* part of the VM?
>> 2. Could you convert those vm-fragments into external ones?
>> 3. Why do we have this distinction in the first place? 
>> Wouldn't it be a little easier to deal with if they were all
>> external (or all internal) rather than half and half?
>
>They are all dealt with as if external (on any platform, BTW). However,
for
>an external named primitive you need some sort of handle to the module
it's
>contained in (call it fragment on Macs, DLLs on Win, or DSO on Unix) and
the
>'trick' is to get a handle to the VM itself. Normally, you get this handle
>by loading the external module into the address space of the VM but since
>the VM itself is already loaded you need an implicit way of getting a
handle
>to the VM. That's what John is fighting here.

Just for the heck of it, I dl-ed the Mozilla sources as Andrew suggested,
but I couldn't find anything to explain why John would have a problem here.
The relevant code appears to be in macdll.c, found in:

MacMozillaSource/Mozilla Source/ns/nsprpub/pr/src/md/mac

There are two or three bugs in the CFM code that they work around,
including a 63 character limit on finding a symbol name using the standard
CFM API, as well as an issue when loading a non-code-containing fragment.
They've also implemented a user-specified loader-path for sub-libraries [I
think that's what it does].

Everything else looks to be pretty standard. They've just wrapped the CFM
calls inside an NS-specific dll-class library, as far as I can tell.


You *might* look at the code for LibInPefContainer() in macdll.c, which
appears to be a pretty complete library search function.

Hope this helps.

-------------------------------------------------------------------------
Lawson English. Squeak, snore, etc.
Check out <http://www.squeak.org>
-------------------------------------------------------------------------







More information about the Squeak-dev mailing list