代码之家  ›  专栏  ›  技术社区  ›  Jonathan Parker

.NET/C中有哪些宽松的例外?

  •  4
  • Jonathan Parker  · 技术社区  · 17 年前

    我在Reflector中查看程序集时发现了它的compilationRelations属性。 This link 表示该属性指定是否:

    优化器可以为宽松的异常提供额外的自由度。

    什么是宽松的异常,编译器在赋予它们“额外的自由”的情况下做什么?

    1 回复  |  直到 17 年前
        1
  •  4
  •   Reed Copsey    17 年前

    这使得编译器在优化时具有更大的灵活性。

    见 the help for the CompilationRelaxations enum 详情。

    ---编辑---

    此时,有一个属性使用的枚举,只有1个选项:nostingInterning

    从msdn帮助,此:

    Marks an assembly as not requiring string-literal interning.
    
    In an application domain, the common language runtime creates one string 
    object for each unique string literal, rather than making multiple copies.
    This behavior, called string interning, internally requires building 
    auxiliary tables that consume memory resources. 
    

    不过,该属性被指定为使用枚举,因此以后可以轻松地添加更多选项。不过,这是目前唯一允许通过此assembly属性进行的优化。

    推荐文章