HydraTools and minimal images

Igor Stasenko siguctua at gmail.com
Fri Feb 15 22:57:58 UTC 2008


On 15/02/2008, Klaus D. Witzel <klaus.witzel at cobss.com> wrote:
> On Fri, 15 Feb 2008 16:56:45 +0100, Igor Stasenko wrote:
>
>
>  > On 15/02/2008, Klaus D. Witzel wrote:
>  >> On Fri, 15 Feb 2008 13:56:37 +0100, Igor Stasenko wrote:
>  >>
>  >>  ...[snipped a lotta rock'n roll]...
>  >>
>  >> > For this reasons, i'd like to operate with interpreters using handles
>  >>  > instead of indexes.
>  >>
>  >>
>  >> Here you seem to demonstrate an enormous lack of inconsistency :( In a
>
> [oops, s/of incons/of cons/]
>
> >>  previous posting you advertise use of an index
>  >>
>  >
>  > It's just doits.
>
>
> How do you mean that, is (sms := HydraSMS doitAt: 2), the statement you
>  seem to be concerned about, not doit?
>
>
>  > If you look at regular code in classes i never using
>  > #at: patterns, only handles.
>
>
> No, I looked at HydraVM>>#doit:at:, subtracted one colon and therefore got
>  HydraSMS>>#doitAt: ... :)
>
>
>  >>  -
>  >> http://lists.squeakfoundation.org/pipermail/squeak-dev/2008-February/125150.html
>  >>
>  >> which suddenly no longer shall be used?
>  >>
>  >
>  > you can use them in doits,
>
>
> But I did ! (sms := HydraSMS doitAt: 2)
>

Primitives accept only handles. So you should use
#pritimiveInterpreterInstanceAt
or HydraVM interpreters at: to obtain a handle.

>
>  > i'm just wanted to say, that in objects it
>  > better to keep handles, not indexes.
>
>
> I cannot see any reason for this. The collection is created and populated
>  by+after startup.
>
HydraVM>>#interpreters returning a freshly populated collection each
time you calling it.
Actually this method was for convenience to iterate through all
interpreter instances.


>  BTW: can you run a snapshot of a Hydra-infected .image (which may contain
>  your handles) with a non-Hydra interpreter .exe?
>
Yes, i can. A handles not anything special but just integers at language side.
In same way, as SocketHandle is just bytearray in ST, but pointer to
structure for VM.


Okay, a little more reasoning, and i will change primitives to use
indexes instead of handles.
The only reason why its better is only for speed reasons: all
primitives should check if handle is valid, so it you have 100 images,
it can take to iterate through list of 100 intems to verify that
handle is valid.
But for security reasons, i'm still thinking that handles are better.

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list