zoukankan      html  css  js  c++  java
  • C语言中的register关键字

    A register variable declaration advises the compiler that the variable in question will be heavily used. 

    register的声明的变量,告诉编译器,这个变量将会被频繁使用。

    The idea is that register variables are to be placed in machine registers, which may result in samller and faster program. 

    这就要求将register变量存放在机器寄存器中,这可以带来更小,更快的程序。

    But programs are free to ignore the advice.

    但是,程序有权忽略这个建议。

    The register variable declaration can only be appied to automatic variables, and to the formal parameters of a functions.

    这个寄存器变量声明不仅仅可以用在自动变量上,也能用在函数的参数上。

    In practice, there are restrictions on register variables, reflecting the realitied of underlying hardware. 

    实际上,对register的使用是有限制条件的,这个体现在具体硬件上。

    Only a few variables in each function may be ketp in registers, and only certain types are allowed. 

    每个函数中只有很少的变量能够存放在寄存器中,而且,只是确定的类型可以存放在寄存器中。

    Excess register declarations are harmless, however, since the word register is ignored for excess or disallowed declarations. 

    过多的使用寄存器变量并没有坏处,然而,由于“register”会被忽略的。

    And it is not possible to take address of a register variable, regardless of whether the variable is actually placed in register.

    特别注意:不能用&取地址符号,去获取一个register变量的地址,无论这个变量是否被实际得存放在寄存器里了


  • 相关阅读:
    b2c项目基础架构分析(二)前端框架 以及补漏的第一篇名词解释
    b2c项目基础架构分析(一)b2c 大型站点方案简述 已补充名词解释
    SQLite 创建自增长标识列
    【第三方支付】之微信支付
    【第三方登录】之微信第三方登录
    【第三方登录】之QQ第三方登录
    2014年互联网IT待遇【转载】
    有趣的程序
    python备忘录
    JAVA备忘录
  • 原文地址:https://www.cnblogs.com/javaadu/p/11742721.html
Copyright © 2011-2022 走看看