Difference between revisions of "LlSetMemoryLimit/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
 
Line 4: Line 4:
|p1_type=integer|p1_name=limit
|p1_type=integer|p1_name=limit
|return_type=integer|return_subtype=boolean
|return_type=integer|return_subtype=boolean
|func_desc=Request {{LSLP|limit}} bytes to be reserved for this script.
|func_desc=このスクリプトのために{{LSLP|limit}}バイトのメモリを予約するようにリクエストします。
|Return_text=[[TRUE]] if the memory limit was successfully set (or [[FALSE]] if not).
|Return_text=メモリ制限が正常に設定された場合は[[TRUE]](設定されなかった場合は[[FALSE]])。
|func_footer
|func_footer
|spec=
|spec=
This function's behavior is dependent upon the VM the script is using. [[#Mono|Mono]] is the new VM, [[#LSO|LSO]] is the old VM.
この関数の動作は、スクリプトが使用しているVMに依存します。[[#Mono|Mono]]は新しいVMで、[[#LSO|LSO]]は旧VMです。


;Mono:Sets the memory limit for the script.
;Mono:スクリプトのメモリ制限を設定します。
* The memory limit can be set up to 64k.
* メモリ制限は最大で64kまで設定できます。
* The memory limit can not be set lower than the memory currently in use by the script.
* メモリ制限は、スクリプトで現在使用されているメモリよりも低く設定できません。
* All new scripts start with a limit of 64k
* すべての新しいスクリプトは64kの制限で開始されます。
* Mono scripts compiled before this function was introduced continue to use the 64k limit.
* この関数が導入される前にコンパイルされたMonoスクリプトは引き続き64kの制限を使用します。
* A lower limit will effect the amount of memory reported in the viewer UI and by [[llGetObjectDetails]].
* より低い制限は、ビューアUIおよび[[llGetObjectDetails]]によって報告されるメモリの量に影響します。
* The memory limit is not the amount of real memory actually used by the script, just the upper limit on it.
* メモリ制限はスクリプトによって実際に使用されている実際のメモリ量ではなく、その上限です。


;LSO:Has no effect on LSO scripts which will always use exactly 16k
;LSO:LSOスクリプトには常に正確に16kを使用します。何も影響を与えません。
|caveats=
|caveats=
;Mono:When '''''n''''' is too small, llSetMemoryLimit('''''n''''') is ignored and the memory limit is not changed
;Mono:'''n'''が小さすぎる場合、llSetMemoryLimit('''n''')は無視され、メモリ制限は変更されません。
|examples=
|examples=
<source lang="lsl2">
<source lang="lsl2">
Line 60: Line 60:
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llScriptProfiler]]|}}
{{LSL DefineRow||[[llScriptProfiler/ja]]|}}
{{LSL DefineRow||[[llGetSPMaxMemory]]|}}
{{LSL DefineRow||[[llGetSPMaxMemory/ja]]|}}
{{LSL DefineRow||[[llGetMemoryLimit]]|}}
{{LSL DefineRow||[[llGetMemoryLimit/ja]]|}}
{{LSL DefineRow||[[llGetFreeMemory]]|}}
{{LSL DefineRow||[[llGetFreeMemory/ja]]|}}
{{LSL DefineRow||[[llGetUsedMemory]]|}}
{{LSL DefineRow||[[llGetUsedMemory/ja]]|}}
{{LSL DefineRow||[[llGetObjectDetails]]|}}
{{LSL DefineRow||[[llGetObjectDetails/ja]]|}}
|also_events
|also_events
|also_tests
|also_tests

Latest revision as of 16:30, 22 November 2023

要約

関数: integer llSetMemoryLimit( integer limit );

このスクリプトのためにlimitバイトのメモリを予約するようにリクエストします。
メモリ制限が正常に設定された場合はTRUE(設定されなかった場合はFALSE)。を integer で返します。

• integer limit

仕様

この関数の動作は、スクリプトが使用しているVMに依存します。Monoは新しいVMで、LSOは旧VMです。

Mono
スクリプトのメモリ制限を設定します。
  • メモリ制限は最大で64kまで設定できます。
  • メモリ制限は、スクリプトで現在使用されているメモリよりも低く設定できません。
  • すべての新しいスクリプトは64kの制限で開始されます。
  • この関数が導入される前にコンパイルされたMonoスクリプトは引き続き64kの制限を使用します。
  • より低い制限は、ビューアUIおよびllGetObjectDetailsによって報告されるメモリの量に影響します。
  • メモリ制限はスクリプトによって実際に使用されている実際のメモリ量ではなく、その上限です。
LSO
LSOスクリプトには常に正確に16kを使用します。何も影響を与えません。

警告

Mono
nが小さすぎる場合、llSetMemoryLimit(n)は無視され、メモリ制限は変更されません。
All Issues ~ Search JIRA for related Bugs

サンプル

// Memory-walkthrough by Daemonika Nightfire (daemonika.nightfire)

integer limit = 20000; // <- bytes

Test()
{
    llSetText("Limited Memory " + (string)llGetMemoryLimit() +
              "\nUsed Memory " + (string)llGetUsedMemory() +
              "\nFree Memory " + (string)llGetFreeMemory(),<1,1,1>,1);
}

default
{
    state_entry()
    {
        llSetMemoryLimit(limit);
        
        llScriptProfiler(PROFILE_SCRIPT_MEMORY);
        Test();
        llScriptProfiler(PROFILE_NONE);
        
        llSay(0,"This script used at most " + (string)llGetSPMaxMemory() + " bytes of memory during Test.");
    }
}

// Result:
        
// Floating Text:
// Limited Memory 20000
// Used Memory 4972
// Free Memory 15100
        
// Chat:
// [05:11] Object: This script used at most 4972 bytes of memory during Test.

特記事項

経緯

Date of Release 10/08/2011

Search JIRA for related Issues

Signature

function integer llSetMemoryLimit( integer limit );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。