大佬教程收集整理的这篇文章主要介绍了对“extern const int”进行划分的优化,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
extern const int z; int x; do_some_stuff_to_calculate_x(); y = x / z; do_some_stuff_with_y();@H_801_5@file2.c中 @H_801_5@
const int z = Z_INIT_VALUE; // some value defined in some .h file.@H_801_5@兴趣点是file1.c中的除法.由于z是extern,因此在编译时不知道[它将在链接时间中定义].
extern const int common_divisor; extern const int common_addition; void handleTheDamnInterrupt(void) { int x = *(REG_foo_1); int y = x / common_divisor; y += common_addition; if( x > some_value ) { y += blah_blah; } else { y += foo_bar; } *(REG_BAR_1) = y; }@H_801_5@该功能是所有程序中的典型功能形式.无法准确知道分区对程序的影响有多大,因为我有许多具有不同周期性的函数.
以上是大佬教程为你收集整理的对“extern const int”进行划分的优化全部内容,希望文章能够帮你解决对“extern const int”进行划分的优化所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。