In article <01bc300c$247f6200$0e096dce@my-pc.neosoft.com>, "Pat Rogers" wrote: >> You have to admit that the attribute >> >> X'Size_In_Storage_Elements >> >> would make a lot of sense. In practice, knowing the number of storage >> elements occupied by an object is much more useful than knowing the >number >> of bits. >> >> Surprisingly, this attribute was not included in Ada 95! > >From the RM: > >145 S�Max_Size_In_Storage_Elements > For every subtype S: > >146 Denotes the maximum value for Size_In_Storage_Elements that will be >requested via Allocate for an > access type whose designated subtype is S. The value of this attribute is >of type universal_integer. > See 13.11.1. > >Close enough? No, because that attribute only applies to memory allocated via an allocator. I wanted an attribute I could apply to stack objects: declare O : T; begin write (addr => O'Address, nbytes => O'Size_In_Storage_Elements); end; instead of declare O : T; begin write (addr => O'Address, nbytes => O'Size / 8); end; (Of course, T is a first-named subtype whose size is an integral multiple of System.Storage_Unit. And in this case, System.Storage_Unit = 8.) Matt -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271