Legacy:GarbageCollect: Difference between revisions

From Spherical
Jump to navigation Jump to search
created from http://web.archive.org/web/20110731232702/http://www.spheredev.org/wiki/GarbageCollect
 
filled
 
Line 1: Line 1:
 
[[API:GarbageCollect|GarbageCollect]] invokes SpiderMonkey's garbage collection routine, which will destroy any unused objects, freeing their memory.
 
GarbageCollect invokes SpiderMonkey's garbage collection routine, which will destroy any unused objects, freeing their memory.


__TOC__
__TOC__


==Usage==
==Usage==
{{Usage|returns={{{returns}}}|object={{{object}}}|func=GarbageCollect|params={{{params}}}}}
{{Usage|func=GarbageCollect}}


* '''param1''' type. param1 description
==Notes==
* '''param2''' type. param2 description
[[API:GarbageCollect|GarbageCollect]] will usually not be needed for most games. You should consider using it if your game creates and destroys a lot of objects in a short space of time and appears to be taking up more memory than it should. In this case, adding a call to [[API:GarbageCollect|GarbageCollect]] may help.
* '''paramN''' type. paramN description


==Examples==
(examples with syntaxhighlighted code)
==Notes==
(notes)


==See also==
{{API:Script/navbox}}
* see also
* see also
* see also
* etc

Latest revision as of 02:32, 2 June 2013

GarbageCollect invokes SpiderMonkey's garbage collection routine, which will destroy any unused objects, freeing their memory.

Usage

GarbageCollect();


Notes

GarbageCollect will usually not be needed for most games. You should consider using it if your game creates and destroys a lot of objects in a short space of time and appears to be taking up more memory than it should. In this case, adding a call to GarbageCollect may help.


API:Script/navbox