![]() |
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:
PHP Code:
PHP Code:
Can anyone please clear this up for me? Then, if I go: PHP Code:
Chris Zakuto PS: Yes, I'm a Java geek. |
References do exist, all object type vars are references. So y and x in your example would point to same object. And I really have no idea about garbage collection except that Stefan said he thought it was rather nice. For copying objects you would use new ObjectReference(); with a name being optional.
|
TStaticVar is called like that because it is not just a variant variable, which is just containing a single value of dynamic type.
When you assign a TStaticVar to a normal variable, then only a link to the TStaticVar is remembered. When there is no link to a TStaticVar anymore, then the variable will be deleted on the next run of the garabage collector. In v4 the garbage collector has been improved to delete two (or more) TStaticVars which are only referencing each other. TStaticVars can only survive that when there is a global variable which is directly or indirectly linking to them. |
Quote:
|
Quote:
|
What if the you did something like
PHP Code:
|
The script wouldn't continue until start() is done unless it uses a trigger for something.
|
| All times are GMT +2. The time now is 07:07 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.