Skip to content

Instantly share code, notes, and snippets.

@ptomato
Last active November 10, 2016 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptomato/8d08327a278b0ac331cb41788acc94d9 to your computer and use it in GitHub Desktop.
Save ptomato/8d08327a278b0ac331cb41788acc94d9 to your computer and use it in GitHub Desktop.
#include "jsapi.h"
int main(int argc, const char *argv[])
{
JS_Init();
JSRuntime *rt = JS_NewRuntime(8L * 1024 * 1024, JS_USE_HELPER_THREADS);
if (!rt)
return 1;
JSContext *cx = JS_NewContext(rt, 8192);
if (!cx)
return 1;
{
JSAutoRequest ar(cx);
JS::CompileOptions options(cx);
}
JS_DestroyContext(cx);
JS_DestroyRuntime(rt);
JS_ShutDown();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment