Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cxx-abi-dev] ABI limitation on the size of a class


  • To: Christian BRUEL <christian.bruel@xxxxxx>
  • Subject: Re: [cxx-abi-dev] ABI limitation on the size of a class
  • From: Nathan Sidwell <nathan@xxxxxxxxxxxxxxxx>
  • Date: Wed, 23 Feb 2005 16:44:03 +0000

Christian BRUEL wrote:

I'm trying to understand the rational for the 1.2 Limit section in the itanium C++ ABI (http://www.codesourcery.com/cxx-abi/abi.html#limits)

The section says that this limitation is due to RTTI implementation. Is it because of the field to the beginning of the complete type in the typeinfos ? in the libstdc++ sources (gcc 3.3.3) this field ("whole_object" field) has type ptrdiff_t so the only limitation I can find in the size of an object is 2**31 bytes for a 32 bit machine.

the __base_class_type_info contains an __offset_and_flags field of type
long.  The first 8 bits are flags about the base
    enum __offset_flags_masks
      {
	__virtual_mask = 0x1,
	__public_mask = 0x2,
	__hwm_bit = 2,
	__offset_shift = 8          // Bits to shift offset.
      };

the remaining 56 (or 24 on 32bit systems) bits are the offset to the base
(or offset in the vtable, for virtual bases).  As this includes a sign
bit the base must be within 2^55 (2^23) bytes of the derived object.

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@xxxxxxxxxxxxxxxx    ::     http://www.planetfall.pwp.blueyonder.co.uk