A
Adam Warner
Hi all,
I have a situation where I need another "colour" of a class in order to
type distinguish it from a base class. I am considering subclassing the
base class without extending its implementation. In the Sun HotSpot VM
will this result in an additional two machine word overhead compared to
the base class? Every Java object in the Sun HotSpot VM has a pointer
sized type information block and a pointer sized status field:
<www.elis.ugent.be/~kvenster/papers/cgo2006/VenstermansK_SelectiveTypedVirtualAddressing.pdf>
class BaseClass {
[fields]
public BaseClass() {}
[final methods]
}
final class SubClass extends BaseClass {
public SubClass() {}
}
The base class instantiates a fixed amount of data. In pseudocode, will
sizeof(SubClass)==sizeof(BaseClass); or
sizeof(SubClass)==sizeof(BaseClass)+8 on 32-bit platforms; or
sizeof(SubClass)==sizeof(BaseClass)+16 on 64-bit platforms?
Thanks,
Adam
I have a situation where I need another "colour" of a class in order to
type distinguish it from a base class. I am considering subclassing the
base class without extending its implementation. In the Sun HotSpot VM
will this result in an additional two machine word overhead compared to
the base class? Every Java object in the Sun HotSpot VM has a pointer
sized type information block and a pointer sized status field:
<www.elis.ugent.be/~kvenster/papers/cgo2006/VenstermansK_SelectiveTypedVirtualAddressing.pdf>
class BaseClass {
[fields]
public BaseClass() {}
[final methods]
}
final class SubClass extends BaseClass {
public SubClass() {}
}
The base class instantiates a fixed amount of data. In pseudocode, will
sizeof(SubClass)==sizeof(BaseClass); or
sizeof(SubClass)==sizeof(BaseClass)+8 on 32-bit platforms; or
sizeof(SubClass)==sizeof(BaseClass)+16 on 64-bit platforms?
Thanks,
Adam