Potty Little Details

Just another WordPress.com weblog

Here’s what the new operator does………….

leave a comment »

  • It allocates memory for the object by allocating the number of bytes required for the specified type from the managed heap.
  • It initializes the object’s overhead members. Every object instance has two additional members associated with the instance that the CLR uses to manage the object. The first member is the object’s pointer to the type’s method table, and the second member is a SyncBlockIndex.
  • The type’s instance constructor is called, passing it any parameters (the string “ConstructorParam1″, in the preceding example) specified in the call to new. Although most languages compile constructors so that they call the base type’s constructor, the CLR doesn’t require this call.
  • After new has performed all these operations, it returns a reference to the newly created
    object.
Advertisements

Written by oneil

September 13, 2008 at 3:23 am

Posted in Framework

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: