Practical limit on size of class

V

vijay

Fowllowing is the experpts of a C++ documents associated with Itanium ABI
Can some body explain what exctly this mean
"The offset of a non-virtual base subobject in the full object containing it
must be representable by a 56-bit signed integer (due to RTTI
implementation). This implies a practical limit of 2**55 bytes on the size
of a class.

Thanks
Vijay
 
D

David White

vijay said:
Fowllowing is the experpts of a C++ documents associated with Itanium ABI
Can some body explain what exctly this mean
"The offset of a non-virtual base subobject in the full object containing it
must be representable by a 56-bit signed integer (due to RTTI
implementation). This implies a practical limit of 2**55 bytes on the size
of a class.

The document mixes up bits and bytes. Assuming it's bits, a 56-bit signed
integer is capable of representing a value +/- 2 to the power of 55. So the
size of an object can't be larger than that if the implementation needs to
keep its size in such an integer. This is no doubt a limit imposed by a
specific compiler on a given machine. Every compiler has to impose
reasonable limits for everything.

Were you thinking that 2**55 is too small?

DW
 
E

E. Robert Tisdale

vijay said:
Following is the experts of a C++ documents associated with Itanium ABI
Can some body explain what exactly this means
"The offset of a non-virtual base subobject in the full object containing it
must be representable by a 56-bit signed integer
(due to RTTI implementation).
This implies a practical limit of 2**55 bytes on the size of a class.

What!
That's only about 36 quadrillion bytes!
Totally unacceptable.
 
A

Andrey Tarasevich

vijay said:
Fowllowing is the experpts of a C++ documents associated with Itanium ABI
Can some body explain what exctly this mean
"The offset of a non-virtual base subobject in the full object containing it
must be representable by a 56-bit signed integer (due to RTTI
implementation). This implies a practical limit of 2**55 bytes on the size
of a class.
...

It means what it says. It means that in order to support some
RTTI-related functionality (like, for example, 'dynamic_cast' downcasts)
in multiple-inheritance object hierarchy the program needs to know and
be able to store offsets of base class subobjects of virtually any
object at run time. In the above implementation this information happens
to be stored in 56-bit signed integer field with +-2**55 value range.
Under this circumstances the implementation is forced to use 2**55 as
object size limit, since permitting base class subobjects larger than
2**55 bytes may easily result in offset values out of +-2**55 range.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top