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.
30 lines
693 B
30 lines
693 B
=proto
|
|
duk_context *duk_create_heap_default(void);
|
|
|
|
=summary
|
|
<p>Create a new Duktape heap and return an initial context (thread).
|
|
If heap initialization fails, a <code>NULL</code> is returned. There is
|
|
currently no way to obtain more detailed error information.</p>
|
|
|
|
<p>The created heap will use default memory management and fatal error
|
|
handler functions. This API call is equivalent to:</p>
|
|
<pre class="c-code">
|
|
ctx = duk_create_heap(NULL, NULL, NULL, NULL, NULL);
|
|
</pre>
|
|
|
|
=example
|
|
duk_context *ctx = duk_create_heap_default();
|
|
if (ctx) {
|
|
/* success */
|
|
|
|
/* ... after heap is no longer needed: */
|
|
duk_destroy_heap(ctx);
|
|
} else {
|
|
/* error */
|
|
}
|
|
|
|
=tags
|
|
heap
|
|
|
|
=introduced
|
|
1.0.0
|
|
|