JS_SetScriptStackQuota

This article covers features introduced in SpiderMonkey 1.8

Obsolete since JavaScript 1.8.6
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Set the maximum amount of memory a context will use for certain data structures.

Syntax

void
JS_SetScriptStackQuota(JSContext *cx, size_t quota);
Name Type Description
cx JSContext * The context to configure.
quota size_t The desired stack quota setting, in bytes.

Description

Set the quota on the number of bytes that stack-like data structures can use when the runtime compiles and executes scripts. These structures also consume heap space, so JS_SetThreadStackLimit does not bound their size. The default quota is 32MB which is quite generous.

The function must be called before any script compilation or execution API calls, i.e. either immediately after JS_NewContext or from the JSCONTEXT_NEW context callback.

See Also

Document Tags and Contributors

 Contributors to this page: arai, fscholz, Sheppy, Jorend
 Last updated by: arai,