mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
649 B
20 lines
649 B
=proto
|
|
void duk_gc(duk_context *ctx, int flags);
|
|
|
|
=summary
|
|
<p>Force a mark-and-sweep garbage collection round. If mark-and-sweep is
|
|
disabled in the Duktape build, the call is a no-op. The flags field is a
|
|
placeholder; no flags are defined at the moment.</p>
|
|
|
|
<p>You may want to call this function twice to ensure even objects with
|
|
finalizers are collected. Currently it takes two mark-and-sweep rounds
|
|
to collect such objects. First round marks the object as finalizable and
|
|
runs the finalizer. Second round ensures the object is still
|
|
unreachable after finalization and then frees the object.</p>
|
|
|
|
=example
|
|
duk_gc(ctx, 0);
|
|
|
|
=tags
|
|
memory
|
|
heap
|
|
|