Ray's playground

 

Primitive, Reference, and Value Types(Chapter 5 of CLR via C#)

You need to bear in mind some performance considerations when you’re working with reference types . First, consider these facts:

The memory must be allocated from the managed heap .

Each object allocated on the heap has some additional overhead members associated with it that must be initialized .

The other bytes in the object (for the fields) are always set to zero .

Allocating an object from the managed heap could force a garbage collection to occur 

At runtime, the C# runtime binder resolves a dynamic operation according to the runtime type of the object . The binder first checks to see if the type implements the IDynamicMetaObjectProvider interface . If the object does implement this interface, then the interface’s GetMetaObject method is called, which returns a DynamicMetaObject- derived type . This type can process all of the member, method, and operator bindings for the object . Both the IDynamicMetaObjectProvider interface and the DynamicMetaObject base class are defined in the System.Dynamic namespace, and both are in the System .Core . dll assembly  

posted on 2011-07-31 15:22  Ray Z  阅读(300)  评论(0编辑  收藏  举报

导航