digitalmars.D.learn - inlining
- spir (14/14) Dec 07 2010 Hello,
- Christopher Nicholson-Sauls (5/22) Dec 07 2010 DMD performs inlining as it deems appropriate, but only if the '-inline'
Hello, Does dmd inline when appropriate (eg single-line func)? or is there a hint = keyword? or what else? Eg how to have this inlined: private bool isPrecomposedHangulSylable (Code code) { /** whether code is a precomposed Hangul syllable ;-) */ return (code >=3D FIRST_HANGUL_SYLLABLE) && (code <=3D LAST_HANGUL_SYLL= ABLE); } Thank you, Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 07 2010
On 12/07/10 05:05, spir wrote:Hello, Does dmd inline when appropriate (eg single-line func)? or is there a hint keyword? or what else? Eg how to have this inlined: private bool isPrecomposedHangulSylable (Code code) { /** whether code is a precomposed Hangul syllable ;-) */ return (code >= FIRST_HANGUL_SYLLABLE) && (code <= LAST_HANGUL_SYLLABLE); } Thank you, Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comDMD performs inlining as it deems appropriate, but only if the '-inline' switch is provided on the command line. Generally speaking, very simple one-liners like yours will get inlined. -- Chris N-S
Dec 07 2010