D - Size of a class
- Dario (9/9) Oct 18 2003 How can I find the size of a class?
- Sean L. Palmer (11/16) Oct 18 2003 Can't you do "Object.size" ?
- Walter (7/16) Oct 19 2003 for
- Dario (2/5) Oct 20 2003 Thanks!
How can I find the size of a class? "Object o; return o.size;" doesn't work. It returns the size of the reference. A '.length' field in ClassInfo would be useful (or a '.length' property for classes). I need this because I would like to write a function which returns a byte[] which contains the contents of the class. We'd have to decide if that variable should include the classinfo pointer and the "monitor" (what is this "monitor" exactly?).
Oct 18 2003
Can't you do "Object.size" ? That's the problem with references. IMO they should act as if they actually *are* the object they refer to, in all respects except assignment. I would expect your example "Object o; return o.size;" to return the same thing as "return Object.size;" There are a whole bunch of things that would be nice to have in the ClassInfo... Sean "Dario" <supdar yahoo.com> wrote in message news:bmrc5d$16c3$2 digitaldaemon.com...How can I find the size of a class? "Object o; return o.size;" doesn't work. It returns the size of the reference. A '.length' field in ClassInfo would be useful (or a '.length' propertyforclasses).
Oct 18 2003
"Dario" <supdar yahoo.com> wrote in message news:bmrc5d$16c3$2 digitaldaemon.com...How can I find the size of a class? "Object o; return o.size;" doesn't work. It returns the size of the reference. A '.length' field in ClassInfo would be useful (or a '.length' propertyforclasses). I need this because I would like to write a function which returns abyte[]which contains the contents of the class. We'd have to decide if that variable should include the classinfo pointer and the "monitor" (what is this "monitor" exactly?).The size of a class can be obtained from: Object foo; foo.classinfo.init.length;
Oct 19 2003
Walter:The size of a class can be obtained from: Object foo; foo.classinfo.init.length;Thanks!
Oct 20 2003