» 您尚未登录:请 登录 | 注册 | 标签 | 帮助 | 小黑屋 |


发新话题
打印

苹果在GitHub上公布macOS和iOS内核源码

引用:
原帖由 532 于 2017-10-1 15:58 发表
为什么越升级越卡,有结论了吗,加了很多空loop?
是的,其中一段代码为:
复制内容到剪贴板
代码:
/**
* remember to increase this value for each release, the increment doesn't has to be 1 but
*need to be a value that can show how hard we've worked for the new release compare to the
*old release
*/
#define AMAZING_VERSION 11

/**
* call this function whenever there is something should happen but actually doesn't happen
* and/or when there is not enough improvement made through the system
*/
void make_it_amazing(){
    int a, num_loops = AMAZING_VERSION * 10000;
    for( a = 0; a < num_loops; a++ ){
        // pretend something amazing is happening here, our fans need this shit
    }
}
[ 本帖最后由 Hibino 于 2017-10-1 18:18 编辑 ]


本帖最近评分记录
  • yangzhicai 激骚 +1 最骚 Rated by wap 2017-10-1 21:19
  • 532 激骚 +1 恭喜发财 2017-10-1 19:28

TOP

发新话题
     
官方公众号及微博