Labs/Jetpack/JEP/28: Difference between revisions

Jump to navigation Jump to search
Line 82: Line 82:
<tt>memory.'''track'''(''object'', [''name''])</tt>
<tt>memory.'''track'''(''object'', [''name''])</tt>


Marks ''object'' for being tracked. If ''name'' isn't specified, the memory tracker attempts to infer the 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&mdash;which is assumed to be a constructor function&mdash;is used.
Marks ''object'' for being tracked, and categorizes it with the given name. If ''name'' isn't specified, the memory tracker attempts to infer the 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&mdash;which is assumed to be a constructor function&mdash;is used.
 
<tt>memory.'''getLiveObjects'''([''name''])</tt>
 
Returns an <tt>Array</tt> of all live tracked objects that have been categorized with the given name.


== Modules ==
== Modules ==
874

edits

Navigation menu