• VS编译小技巧(更新中)


    VS编译小技巧

    指令 作用
    #pragma optimize("gs", on/off) 开启/关闭函数优化。有了它,终于可以在Release模式下避免因为优化而看不到的局部变量了!

    optimize

    • 02/04/2013
    • 2 minutes to read

    Specifies optimizations to be performed on a function-by-function basis.

    #pragma optimize( "[optimization-list]", {on | off} )
    

    Remarks

    The optimize pragma must appear outside a function and takes effect at the first function defined after the pragma is seen. The on and off arguments turn options specified in the optimization-list on or off.

    The optimization-list can be zero or more of the parameters shown in the following table.

    Parameters of the optimize Pragma

    Parameter(s) Type of optimization
    g Enable global optimizations.
    s or t Specify short or fast sequences of machine code.
    y Generate frame pointers on the program stack.

    These are the same letters used with the /O compiler options. For example, the following pragma is equivalent to the /Os compiler option:

    #pragma optimize( "ts", on )
    

    Using the optimize pragma with the empty string ("") is a special form of the directive:

    When you use the off parameter, it turns the optimizations, listed in the table earlier in this topic, off.

    When you use the on parameter, it resets the optimizations to those that you specified with the /O compiler option.

    #pragma optimize( "", off )
    .
    .
    .
    #pragma optimize( "", on ) 
    
  • 相关阅读:
    【ZOJ3195】Design the City-LCA算法
    【ZOJ3195】Design the City-LCA算法
    【POJ1330】Nearest Common Ancestors-LCA算法
    【POJ1330】Nearest Common Ancestors-LCA算法
    【POJ3237】Tree-树链剖分
    【POJ3237】Tree-树链剖分
    【SPOJ375】Query on a tree-树链剖分
    perl 回调必须是函数引用
    运行复制的ZooKeeper 部署
    运行复制的ZooKeeper 部署
  • 原文地址:https://www.cnblogs.com/that-boy/p/12348176.html
Copyright © 2020-2023  润新知