WoW:API collectgarbage: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
<center>'''collectgarbage''' ''-Documentation by [[user:Aradan|Aradan]], Update by [[user:CuteMiyu|CuteMiyu]]-''</center>
Control the garbage collector and query it for information. As of WoW 2.0, this is the same as the standard collectgarbage() in Lua, but prior to that it was quite different.
 
Sets garbage collection limit and calls the garbage collector if the Lua byte counter exceeds this limit.
 
Since WoW 2.0, it change to Lua 5.1. Lua 5.1 changed collectgarbage design, and you need update your script or AddOn if you used this function.


  collectgarbage(opt [, arg])
  collectgarbage(opt [, arg])
Line 26: Line 22:
  collectgarbage("count") -- return kilobytes of memory in use, i.e. 2048 for 2 megabytes
  collectgarbage("count") -- return kilobytes of memory in use, i.e. 2048 for 2 megabytes


== Note ==
There is a [[Lua]] function with the exact same name but its parameters and behavior is quite different from the WoW API version.
----
__NOTOC__
__NOTOC__
Anonymous user