swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[resend] Re: Memory exhaustion


From: Marcus G. Daniels
Subject: [resend] Re: Memory exhaustion
Date: 22 Dec 2001 11:45:16 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.7

[There was a problem on Friday with the SFI mailing list configuration.
 All messages sent were lost.]

FW> I remember we had a discussion about FAction a while ago. I find
FW> the language construction difficult to understand, yet I
FW> appreciate that it is important to use it. Especially the argument
FW> of type FArguments to FCall is puzzling.

The simple answer is that methods can have arguments, and this is where
you put them.

An FArguments instance is an object that contains the list of
arguments to a call.  It's like a List object, but it is special
because it handles primitive types.  For example, you can't put a 64
bit floating point value in a List because that value is not an object
(and on most platforms an object is only 32 bis), and lists want
objects.  (Yes, Java handles that by having wrapper classes like
Double, but that can be undesirable because it is an extra object and
sometimes a method in a library not under your control has a method
that takes primitive types as arguments.)

FArguments provides an abstract, language-neutral representation of
values to be passed to a method.  So, whether the call (an FCall
instance) ends up being a Java or COM or JavaScript or C, an
FArguments can be attached to any of them. 

MD>       try {
MD>         Selector sel =
MD>          new Selector (Class.forName("TargetBug"), "uniformMotion", false);
MD>         FArguments fa = new FArgumentsImpl (getZone (), sel);
MD>         FCall fc = new FCallImpl (getZone (),
MD>                                   targetList.getFirst (),
MD>                                   sel, fa);

FW> The 'Object' argument seems strange... Why an object and not a class (I am
FW> aware that this is a rhetorical question)?

I guess you mean the "targetList.getFirst ()".  A FCall is concerned
with making a call on a specific object with specific arguments.  It
sets up a frame, uses FArguments to stuff the appropriate values for
the call arguments in the frame (or callout interface), in a
language-specific way, and makes the call in a language specific way.
It tries to leave as much `sitting in place' so that when the call is
made and remade, there is low overhead.

In this case, FArguments/FCall is useful because it lets you state
explicitly to Swarm that the target of the object is a Java object,
instead of `some kind of object' that needs further bookkeeping and
checking at runtime.

FW> I've changed my code to this, it crashes here, and the debugging output
FW> isn't very informative either (see below). I've tried to pop another object
FW> from the list and also to cast it to TargetBug but that doesn't help.

Are you using the latest pretest of 2.2 or 2.1.1?  What platform?
I don't test my examples anymore on 2.1.1.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]