=proto void duk_free(duk_context *ctx, void *ptr); =summary

Like duk_free_raw() but may involve garbage collection steps. The garbage collection interaction cannot cause the operation to fail.

duk_free() can be used to free memory allocated with either duk_alloc() or duk_alloc_raw() and their reallocation variants.

Currently a duk_free() cannot cause a garbage collection pass but does update internal GC trigger counters.
=example void *buf = duk_alloc(ctx, 1024); /* ... */ duk_free(ctx, buf); /* safe even if 'buf' is NULL */ =tags memory =seealso duk_free_raw