JSRuntime * JS_NewRuntime(uint32_t maxbytes, uint32_t maxNurseryBytes = JS::DefaultNurseryBytes, JSRuntime *parentRuntime = nullptr); JSRuntime * JS_NewRuntime(uint32_t maxbytes, JSUseHelperThreads useHelperThreads, JSRuntime *parentRuntime = nullptr); // Deprecated since JSAPI 32
||Maximum number of allocated bytes after which garbage collection is run.|
||Nursery size in bytes.
||The topmost parent or
JS_NewRuntime before making any other API calls except
JS_NewRuntime allocates memory for the
JSRuntime and initializes certain internal runtime structures.
maxbytes specifies the number of allocated bytes after which garbage collection is run. If
parentRuntime is specified, the resulting runtime shares significant amounts of read-only state (the self-hosting and initial atoms compartments). It is recommended to make use of this for every runtime in a process after the first one.
JSRuntime can be used from the calling thread only. (The engine may use helper threads internally, though.)
JS_NewRuntime returns a pointer to the newly created runtime, which the caller must later destroy using
JS_DestroyRuntime. Otherwise it returns