mabby it is a silly question)
i have a small misunderstanding:
“newobj” makes the CLR to:
1) calculate how much memory the object need
2) if the heap has enough memory – invoke a constructor,
retrieve a link of the new object in memory to the main code
(the adress is the last position of pointer to the next object)
3) BEFORE! the reference is retrieved move pointer to the next object
here is an example:
Car myCar = new Car;
so, if i understand, the compiler write the “link to the next object”
into myCar ?? if we need the compiler to write the “link to our object”
into my car..
if You can, please describe how it really works
Invoked a constructor of
Cartype, with invokation chain of all parent types begining from the deepest one.Space is allocated, pointer obtained to that memory location and address of that memory assigned to
myCar.Basic steps