hxn

Meter

Tracks the memory one library's values hold, which the collector cannot measure, and decides when to run a collection for it. A binding creates one for its library.

Constructor

function new(held:() -> Float, wanted:() -> Bool)

held returns the number of bytes the library's values report. wanted returns whether the library has requested a collection since wanted was last called.

Properties

var held(get, null):Float

The number of bytes the library's live values report.

Methods

function check():Void

Runs a collection if the library requested one or its values hold more than the limit. Called on a Haxe thread, outside a collection.