jSGarbageCollect top-level property

void Function(Pointer<NativeType> ctx) jSGarbageCollect
final

Performs a JavaScript garbage collection. JavaScript values that are on the machine stack, in a register, protected by JSValueProtect, set as the global object of an execution context, or reachable from any such value will not be collected.

During JavaScript execution, you are not required to call this function; the JavaScript engine will garbage collect as needed. JavaScript values created within a context group are automatically destroyed when the last reference to the context group is released. ctx (JSContextRef) The execution context to use.

Implementation

final void Function(Pointer ctx) jSGarbageCollect = JscFfi.lib
    .lookup<NativeFunction<Void Function(Pointer)>>('JSGarbageCollect')
    .asFunction();