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.
25 lines
622 B
25 lines
622 B
11 years ago
|
=proto
|
||
11 years ago
|
void duk_require_stack_top(duk_context *ctx, duk_idx_t top);
|
||
11 years ago
|
|
||
|
=summary
|
||
11 years ago
|
<p>Like <code><a href="#duk_check_stack_top">duk_check_stack_top()</a></code>
|
||
11 years ago
|
but an error is thrown if the value stack needs to be reallocated and that
|
||
|
reallocation fails.</p>
|
||
|
|
||
|
<p>As a general rule, callers should use this function to reserve more
|
||
|
stack space. If value stack cannot be extended, there is almost never a
|
||
|
useful recovery strategy except to throw an error and unwind.</p>
|
||
|
|
||
|
=example
|
||
|
duk_require_stack_top(ctx, 100);
|
||
|
printf("value stack guaranteed up to index 99\n");
|
||
|
|
||
|
=tags
|
||
|
stack
|
||
|
|
||
|
=seealso
|
||
|
duk_check_stack_top
|
||
10 years ago
|
|
||
|
=introduced
|
||
|
1.0.0
|