Skip to main content

Home/ Coders/ Group items tagged clr

Rss Feed Group items tagged

Joel Bennett

Module initializers in C# - 6 views

  •  
    One feature of the CLR that is not available in C# or VB.NET are module initializers (or module constructors). A module initializer is simply a global function which is named .cctor and marked with the attributes SpecialName and RTSpecialName. It is run when a module (each .NET assembly is comprised of one or more modules, typically just one) is loaded for the first time, and is guaranteed to run before any other code in the module runs, before any type initializers, static constructors or any other initialization code.
Matteo Spreafico

Fabulous Adventures In Coding : The Stack Is An Implementation Detail, Part One - 0 views

  • Almost every article I see that describes the difference between value types and reference types explains in (frequently incorrect) detail about what “the stack” is and how the major difference between value types and reference types is that value types go on the stack.
  • I find this characterization of a value type based on its implementation details rather than its observable characteristics to be both confusing and unfortunate. Surely the most relevant fact about value types is not the implementation detail of how they are allocated, but rather the by-design semantic meaning of “value type”, namely that they are always copied “by value”.
  • Of course, the simplistic statement I described is not even true. As the MSDN documentation correctly notes, value types are allocated on the stack sometimes. For example, the memory for an integer field in a class type is part of the class instance’s memory, which is allocated on the heap.
  • ...3 more annotations...
  • As long as the implementation maintains the semantics guaranteed by the specification, it can choose any strategy it likes for generating efficient code
  • That Windows typically does so, and that this one-meg array is an efficient place to store small amounts of short-lived data is great, but it’s not a requirement that an operating system provide such a structure, or that the jitter use it. The jitter could choose to put every local “on the heap” and live with the performance cost of doing so, as long as the value type semantics were maintained
  • I would only be making that choice if profiling data showed that there was a large, real-world-customer-impacting performance problem directly mitigated by using value types. Absent such data, I’d always make the choice of value type vs reference type based on whether the type is semantically representing a value or semantically a reference to something.
Joel Bennett

CLR Add-In Team Blog - 0 views

  •  
    The CLR Add-In team blog ... news about the new System.AddIn that's coming in .Net 3.5
Joel Bennett

.NET Application Extensibility: System.AddIn - CLR Inside Out - MSDN Magazine, February... - 0 views

  •  
    As of .Net 3.5, we will gain a built-in method for doing plugins in the .Net CLR -- This article explains the basics of plugins and is followed by a second article focusing on the new System.AddIn namespace

Joel Bennett

CLR Inside Out: New Library Classes in "Orcas" -- MSDN Magazine, April 2007 - 0 views

  •  
    New CLR libraries incladd-in hosting model, which was discussed in the last two editions of CLR Inside Out
    • Support for the Suite B set of cryptographic algorithms, as specified by the National Security Agency (NSA)
    • Support for big integers
    • A high-performance set collection
    • Support for anonymous and named pipes
    • Improved time zone support
    • Lightweight reader/writer lock classes
    • Better integration with Event Tracing for Windows® (ETW), including ETW provider and ETW trace listener APIs
1 - 5 of 5
Showing 20 items per page