Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
nxp CMSIS の例では、メイン プロシージャの本体にコードを記述する代わりに、次のような別のプロシージャを呼び出します。
int c_entry(void) { //code Entry while(1); return 1; } int main (void) { return c_entry(); }
私たちは記憶を失っているだけだと思いますが、この種のコーディングの利点は何ですか?
ありがとう
私たちは記憶を失うだけだと思う
あなたが思うほどではありません。コンパイラは、Jump への末尾の呼び出しを最適化できるため、追加のスタックの使用はありません。また、c_entry 関数を自動インライン化することもできます。少なくとも GCC は、より高い最適化レベルでそれを行うことができます。