gooブログはじめました!

写真付きで日記や趣味を書くならgooブログ

angelscriptバイナリのサイズの違いについて

2010-01-30 17:12:28 | angelscript

angelscriptをビルドするとデバッグ版よりリリース版のほうがサイズが大きいのが気になって公式フォーラムをみたら 記述がありました。どうやら最適化等によってサイズが大きくなっている模様。以下が原文です。またスクリプト側で #ifdefマクロのような使い方があるとあったのでメモしておく。

 

バイナリのサイズ違いについて


#ifdefと同等な機能をangelscript側に持たせる

<form>

公式フォーラム抜粋(バイナリのサイズ違いについて)

<textarea rows="8" cols="75" readonly="readonly">The size of the binary can also increase a lot if it is optimized for speed rather than size. During this kind of optimization the compiler commonly 'inline' functions and 'roll out' loops, which effectively duplicates the code all over the place. </textarea>

</form>

<form>

公式フォーラム抜粋(#ifdefと同等な機能をangelscript側に持たせる)

add_onフォルダ下にあるCScriptBuilderのDefineWordメソッドを使用する。

<textarea rows="8" cols="75" readonly="readonly">The compiler for your editor could define the word 'EDITOR' with CScriptBuilder::DefineWord("EDITOR");, and the game would define the word 'GAME' in the same way. In the script you can then do: void BasicObj_OnClick(BasicWorldObj@ pthis) { #if EDITOR   creatorContainer.MoveCreateItems();   creatorContainer.CreateFinish(); #endif #if GAME   pthis.SetFocus(move); #endif } </textarea>

</form>

コメントを投稿