874
edits
(→unload: added notes on unload.send().) |
(→memory: updated to reflect latest changes to code) |
||
| Line 104: | Line 104: | ||
<tt>memory</tt> is an object that exposes functionality to track objects of interest and help prevent memory leaks. | <tt>memory</tt> is an object that exposes functionality to track objects of interest and help prevent memory leaks. | ||
<tt>memory.'''track'''(''object'', ['' | <tt>memory.'''track'''(''object'', [''bin''])</tt> | ||
Marks ''object'' for being tracked, and categorizes it with the given name. If '' | Marks ''object'' for being tracked, and categorizes it with the given bin name. If ''bin'' isn't specified, the memory tracker attempts to infer a bin name by first checking the object's <tt>constructor.name</tt>; if that fails or results in the generic <tt>Object</tt>, the stack is inspected and the name of the current function being executed—which is assumed to be a constructor function—is used. | ||
<tt>memory.''' | <tt>memory.'''getObjects'''([''bin''])</tt> | ||
Returns an <tt>Array</tt> of all live tracked objects that have been categorized with the given name. If '' | Returns an <tt>Array</tt> of all live tracked objects that have been categorized with the given bin name. If ''bin'' isn't provided, all live tracked objects are returned. | ||
<tt>memory.'''getBins'''()</tt> | |||
Returns an <tt>Array</tt> of all non-empty bin names. | |||
== Modules == | == Modules == | ||
edits