Should the “Type” reference value be stored in memory?

Because the reference values ​​are stored on the heap as data; Where is the type information of any reference value stored?

If there are multiple instances of the Artist class; when they are stored on the heap, how do .NET tags block memory as an artist type?

thank!

+3
source share
3 answers
void M()
{
   Artist a = new Artist();
}

, CLR , , . CLR , . Artist . , , M(). , a new, . CIL, - newobj blabla. . , . :

Type pointer + Sync root + Instance data

( ). - . .

+5

CLR . - .

+2

, , dotnet , , . , , , , ( ) ( ).

, , .

, , Person, , , . Person , System.Type, type System.Type( , ).

, System.Type, , , , . , , - , System.Type System.Type.

GetType() , , .

0

All Articles