Automatic Memory Management
Like the C runtime, the CLI has been designed to exploit the power of diverse
platforms, as well as to complement existing tools, languages, and runtimes. Let's
look at a few of the likely ways that the Shared Source CLI Implementation might
interest you:
·
There are significant differences in implementation between this code and the
code for Microsoft's commercial CLR implementation, both to facilitate portability
and to make the code base more approachable. If you are a developer who is
interested in knowing how JIT compilers and garbage collectors work, or of how
Microsoft Visual Studio works on your behalf under the covers, this distribution
will definitely hold your attention!
·
The distribution will help you in creating courseware around interesting topics
that can be illustrated by this codebase.
·
The distribution will help you in implementing your own version of the CLI and it
also helps you in understanding the way the compilers and tools target the CLI.
Automatic Memory Management
Now let us discuss about an important feature of the CLR called Automatic Memory
Management. A major feature of .NET framework CLR is that the runtime
automatically handles the allocation and release of an object's memory resources.
Automatic memory management enhances code quality and developer productivity
without negatively impacting expressiveness or performance.
The Garbage Collector (GC) is responsible for collecting the objects no longer
referenced by the application. The GC may automatically be invoked by the CLR or
the application may explicitly invoke the GC by calling GC.Collect. Objects are not
released from memory until the GC is invoked and setting an object reference to
Nothing does not invoke the GC, a period of time often elapses between when the
object is no longer referenced by the application and when the GC collects it.
Common Type System
The Common Type System defines how data types are declared, used, and managed
in the runtime, and is also an important part of the runtime's support for the Cross-
Language Integration. The common type system performs the following functions:
·
Establishes a framework that enables cross-language integration, type safety,
and high performance code execution.
·
Provides an object-oriented model that supports the complete implementation of
many programming languages.
·
Defines rules that languages must follow, which helps ensure that objects written
in different languages can interact with each other.
The Common Type System can be divided into two general categories of types,
Reference type and Value type each of which is further divided into subcategories.
Common Type System Architecture