How to create a windows pluggable primitive?

Tim Rowledge tim at sumeru.stanford.edu
Sat Jun 24 16:28:52 UTC 2000


> >I haven't looked into the latest pluggable primitive stuff, but the
> >approach implied in this code concerns me for use in a Windows DLL. When
> >exactly does "setInterpreter" get called? By whom? How often if you are
> >running multiple Squeak EXEs?
If you look at the file sqNamedPrimitives.c you will see how
setInterpreter, getModuleName etc are used.
The string returned by getModuleName has to start with the same
characters as the _file name_ of the plugin. You can have any suitable
seeming stuff after that to provide human readable version info. (A
recent change from early implementations)

I don't think any thought was given to having multiple users of the same
plugin. Certainly can't remember it coming up in discussions. I imagine
it might be a problem in some cases; we need to get some info from
various OS experts I guess. I don't think I need to worry for Acorn,
since the plugin is bound into the vm executable address space.

> PS: Is there a method to unload a DLL?  Now I've always have to restart 
> Squeak if I what to replace my DLL.
>
Yes. Try Smalltalk unbindExternalPrimitives and Smalltalk unloadModule:
modulename'. Seems to work on Acorn and linux/x86.


tim






More information about the Squeak-dev mailing list