The signature of `deep_physical_size' is:
deep_physical_size (o: ANY): INTEGER
which means that whatever you pass to it is transformed into a full fledge object
which is 24 bytes on 32-bit platform at the minimum (and 32 bytes on 64-bit
platform).
Use the constants defined in the PLATFORM class to find out how much space basic
types do take.
Regards,
Manu
> -----Original Message-----
> From:
eiffel_...@yahoogroups.com
> [mailto:
eiffel_...@yahoogroups.com] On Behalf Of brucemount
> Sent: Thursday, January 14, 2010 6:17 AM
> To:
eiffel_...@yahoogroups.com
> Subject: [eiffel_software] Re: How to tell memory size of an object?
>
> Martin (others):
>
> I used 'deep_physical_size' from INTERNAL which (according to the comment
> in the code) returns "Space occupied by `object' and its children in
> bytes" and got this surprising result:
>
> CHARACTER_8 size: 24
> INTEGER_8 size: 24
> INTEGER_32 size: 24
> INTEGER_64 size: 24
> NATURAL_8 size: 24
> NATURAL_16 size: 24
> NATURAL_32 size: 24
> NATURAL_64 size: 24
>
> Is it really true that expanded types take 24 bytes of storage, no matter
> what the size? It don't understand how a NATURAL_8 and a NATURAL_64 can
> take the same storage size.
>
> Am I doing something wrong?
>
> --Bruce
> ======================================
> > Martin Piskernig <martin.piskernig@> wrote:
> > > Am Dienstag 12 Januar 2010 13:00:36 schrieben Sie:
> > > > Is there a way to tell how much memory and object takes?
> > >
> > > Yes, please have a look at class INTERNAL. It has some queries
> > >like e.g. deep_physical_size(o) which will give the total size
> > >of object "o".
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links