From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../jsapi_reference/js_newruntime/index.html | 52 ---------------------- 1 file changed, 52 deletions(-) delete mode 100644 files/ja/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html (limited to 'files/ja/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html') diff --git a/files/ja/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html b/files/ja/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html deleted file mode 100644 index 5db8397cb9..0000000000 --- a/files/ja/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: JS NewRuntime -slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewRuntime -tags: - - JSAPI Reference - - SpiderMonkey -translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewRuntime ---- -

-

- -

JavaScript ランタイムの初期化を行います。 {{ 英語版章題("Syntax") }}

- -

構文

- -
JSRuntime * JS_NewRuntime(uint32 maxbytes);
-
- - - - - - - - - - - - - - -
NameTypeDescription
maxbytesuint32ガベージコレクション動作後の最大メモリ使用量Maximum number of allocated bytes after which garbage collection is run.
- -

{{ 英語版章題("Description") }}

- -

説明

- -

JS_NewRuntimeは、JavaScriptランタイム環境の初期化を行う関数です。他のJSAPI関数を使うには前もって必ずJS_NewRuntimeを呼ぶことになります。JS_NewRuntimeは、JSRuntimeに用いるメモリ領域を確保し、ランタイム内の初期化を行います。引数maxbytesで、ガベージコレクションが動作した後の最大メモリ使用量を指定します。 <code>JS_NewRuntime</code> initializes the JavaScript runtime environment. Call <code>JS_NewRuntime</code> before making any other API calls. <code>JS_NewRuntime</code> allocates memory for the <code>JSRuntime</code> and initializes certain internal runtime structures. <code>maxbytes</code> specifies the number of allocated bytes after which garbage collection is run.

- -

一般的に、ほとんどのアプリケーションで必要とされるJSRuntimeは一つのみです。JS_THREADSAFEを有効にしたビルドでは、JSRuntimeを共有するJSContextを各スレッドごとに一つ用意することで、複数スレッドからランタイムにアクセスすることが可能です。複数のランタイムが必要になるのは、JavaScriptの値やオブジェクト、関数をスレッド間で完全に分離させたいときだけです。 Generally speaking, most applications need only one <code>JSRuntime</code>. In a <code>JS_THREADSAFE</code> build, each runtime is capable of handling multiple execution threads, using one <code>JSContext</code> per thread, sharing the same <code>JSRuntime</code>. You only need multiple runtimes if your application requires completely separate JS engines that cannot share values, objects, and functions.

- -

JS_NewRuntimeが成功したときは、新たに生成されたランタイムへのポインタがその返り値となり、失敗した時はNULLを返します。JS_NewRuntimeの呼び出し元は、後で必ずそのランタイムをJS_DestroyRuntimeを用いて破棄しなければなりません。 On success, <code>JS_NewRuntime</code> returns a pointer to the newly created runtime, which the caller must later destroy using <code>JS_DestroyRuntime</code>. Otherwise it returns <code>NULL</code>. {{ 英語版章題("Notes") }}

- -

注記

- -

一般的には、JS_NewRuntimeはアプリケーション内でまず最初に実行し、JS_DestroyRuntimeJS_ShutDownを終了時に呼ぶことになります。 Ordinarily, <code>JS_NewRuntime</code> should be the first JSAPI call in an application, and <code>JS_DestroyRuntime</code> and <code>JS_ShutDown</code> should be the last ones.

- -

{{ LXRSearch("ident", "i", "JS_NewRuntime") }}

- -

{{ languages( { "en": "en/JS_NewRuntime" } ) }}

-- cgit v1.2.3-54-g00ecf