swarm-support
[Top][All Lists]
Advanced

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

Temporal Lists


From: David Aliaga
Subject: Temporal Lists
Date: Tue, 11 Jul 2000 00:51:51 -0700 (PDT)

Hello Everyone

A Question about List and the use of memory.

I have a class more or less like this:

@interface aClass:SwarmObject
{ ....(several instance variables)

 id My_Values;

}
...(several methods)
-initializeMyValues;

@end

Also I have another 2 classes like this:
@interface anotherClass:SwarmObject
{
  id <yetAnotherClass> ob1
  id <yetAnotherClass> ob2
}
-initializeObjects:(id)obList;
@end
@interface yetAnotherClass:SwarmObject
{

}
-intialize: (int)i;
@end

Inside the method: "initializeMyValues" I create a
List and then create several objects of
"yetAnotherClass" class and then I put them in the
list.(obList)

Then I create one object of "anotherClass" class(which
I put in MyValues) , and I call a method 
InitializeObjects:obList , which takes one by one the
objects of the list and put them in every instance
variable of the object

After this the method initializeMyValues finish. (it
is going to be called again for other objects)

The question is since the list is a variable inside
the scope of the method, when it finish , the list
(and the memory ocupied by it) also dissapear? ( or
should I explicitily call  something [list drop]?

i ask this because the next time I call initialize My
Values I am going to create again the list and
everything so I dont wanna use more and more memory.

By the way Why should we use drop with index when they
are use temporally. 

Thanks

David 

-initializeMyValues
{ int i;
  id aQV;
  id aQVList;

 aQVList=[List create: [self getZone]];
 for(i=0;i<NEST1;i++)
   {
       aQV=[yetAnotherClass create: [self getZone]];
       [aQV initialize: ((i!=12)?0:1)];
       [aQVList addLast: aQV];
   }
  My_Values=[anotherClass createBegin: [self
getZone]];
   [My_Values intializeObjects: aQVList];
   My_Values=[My_Values createEnd];


// <------Should I put [aQVList drop] here????????

return self;
}



__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/

                  ==================================
   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]