Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What kind of data is stored in 'Type Object pointer' and 'Sync Block Index'?

In CLR, each instance have 2 additional fields to store some data to manage object:

  • Type Object Pointer
  • Sync Block Index

Can you explain basically what do they store inside and briefly how are they used by CLR?

Thanks!

like image 338
pencilCake Avatar asked Mar 03 '12 13:03

pencilCake


1 Answers

The type object pointer is a pointer to a type description of the object. This is used to find out what the actual type of an object is, for example needed to do virtual calls.

The sync block index is an index into a table of synchronisation blocks. Each object can have a sync block, that contains information used by Monitor.Enter and Monitor.Exit.

like image 194
Guffa Avatar answered Oct 28 '22 21:10

Guffa