[Mono-list] mcs compiles on linux. Now what?

Dietmar Maurer dietmar@ximian.com
08 Mar 2002 14:12:39 +0100


All classes derive from Object, even ValueType. So adding a non static
field to Object would also increase the size of all value types, until
we add some special hacks to the runtime. So this solution does not
work.

On Fri, 2002-03-08 at 01:13, Radek Doulík wrote:
> Which bits do you mean? As a temporary solution we could have static int
> counter in Object class and instance int variable, which will be set by
> counter value in constructor? Like this:
> 
> class Object {
> 	static int counter = 0;
> 	private int key;
> 
> 	public Object ()
> 	{
> 		key = counter;
> 		counter ++;
> 	}
> 
> 	public virtual int GetHashCode ()
> 	{
> 		return key;
> 	}
> }
> 
> Which could serve before we could find something better. Actually I am
> not sure, how this works for boxed objects, maybe we cannot have
> instance variable in Object because boxing?
> 
> Cheers
> Radek
> 
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list