[squeak-dev] Better VM <-> plugin API

Igor Stasenko siguctua at gmail.com
Mon Nov 24 19:38:00 UTC 2008


2008/11/24 Greg A. Woods; Planix, Inc. <woods at planix.ca>:
>
> On 21-Nov-2008, at 4:30 PM, Igor Stasenko wrote:
>>
>> 2008/11/21 Greg A. Woods; Planix, Inc. <woods at planix.ca>:
>>>
>>> How is another plugin supposed to access this 'bitBlitAtom' handle that
>>> is
>>> effectively always in the first plugin's private storage and literally
>>> (as
>>> you've declared it above) also in the other plugin module's private
>>> symbol
>>> namespace?  (i.e. if it's compiled as a "static" variable in the first
>>> plugin module then there's no way the second plugin can use the same
>>> symbol
>>> to refer to the same storage)
>>
>> Its not in a private storage. When you telling makeAtom(), you
>> receiving an atom id for given name which is shared among all plugins.
>
> Perhaps I'm assuming your syntax is literal C code when that is not what you
> meant?
>
> The code you wrote explicitly defines a _static_ (i.e. private) symbol for
> storage that only the one compiled source file will be able to see the
> referenced storage, and only within the scope of the definition.

I'm not sure what code you refer to (there was many). A shared
namespace , from definition is not private.
Any module can access a symbol value by its name. In same way how we
using system dictionary in smalltalk.

>
> But I think Andreas Raab hit the nail on the head with his suggested
> ioLoadFunctionFrom() idea.
>

The ioLoadFunctionFrom() having static behavior, e.g. no matter how
many times you call this function, you'll receive same result for same
arguments. Its because, once compiled, an exported symbols values
(function/variable pointers) can't change their values anymore.

> --
>                                        Greg A. Woods; Planix, Inc.
>                                        <woods at planix.ca>
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list