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.
 
 
 
 
 
 

29 lines
843 B

name: duk_gc
proto: |
void duk_gc(duk_context *ctx, duk_uint_t 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.</p>
<p>The following flags are defined:</p>
<table>
<tr><th>Define</th><th>Description</th></tr>
<tr><td>DUK_GC_COMPACT</td><td>Force object property table compaction</td></tr>
</table>
<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
introduced: 1.0.0