JSRuntime * JS_NewRuntime(uint32 maxbytes);
||Maximum number of allocated bytes after which garbage collection is run.|
JS_NewRuntime before making any other API calls.
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.
Generally speaking, most applications need only one
JSRuntime. In a
JS_THREADSAFE build, each runtime is capable of handling multiple execution threads, using one
JSContext per thread, sharing the same
JSRuntime. You only need multiple runtimes if your application requires completely separate JS engines that cannot share values, objects, and functions.
JS_NewRuntime returns a pointer to the newly created runtime, which the caller must later destroy using
JS_DestroyRuntime. Otherwise it returns