View Single Post
  #1  
Old 07-15-2007, 06:40 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Garbage Collection

Yumm, garbage. Someone care to explain to me what all the garbage collection features GS2 has?

Also, do references exist in GS2? For example, say you do this:
PHP Code:
= new TStaticVar(); 
So, a variable n is created; a TStaticVar() is also created, in the memory of the server/client. Let's call the memory address 102 (an example). So n holds a reference to address 102. Now what if we do this:
PHP Code:
n.var1 "blah";
n
Now will x have a reference to 102? Or does it create a new TStaticVar, and then copy the vars? What if I were to do something like this?
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
= new TStaticVar();
  
x;
  
y.var1 "blah";
  echo( 
x.var1 );

What does that echo? I can't get on RC now, and I probably won't be able to for a while.

Can anyone please clear this up for me?

Then, if I go:
PHP Code:
NULL// Not destroying the object, dropping the reference
NULL// Likewise
// Now, as all references are dropped, is the TStaticVar dropped from the memory (collected by garbage collection)? 
Thanks,
Chris Zakuto
PS: Yes, I'm a Java geek.
__________________
Reply With Quote