Practical limit on size of class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vijay

    Practical limit on size of class

    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


  • David White

    #2
    Re: Practical limit on size of class

    vijay <getvijay2k@yah oo.com> wrote in message
    news:bffuld$hui $1@news.mch.sbs .de...[color=blue]
    > 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[/color]
    it[color=blue]
    > 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.[/color]

    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



    Comment

    • David White

      #3
      Re: Practical limit on size of class

      David White <no@email.provi ded> wrote in message
      news:7LLSa.963$ sI.48813@nasal. pacific.net.au. ..[color=blue]
      > The document mixes up bits and bytes.[/color]

      My mistake, since the size (of the object) will be in bytes.

      DW



      Comment

      • E. Robert Tisdale

        #4
        Re: Practical limit on size of class

        vijay wrote:
        [color=blue]
        > 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.[/color]

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

        Comment

        • Andrey Tarasevich

          #5
          Re: Practical limit on size of class

          vijay wrote:[color=blue]
          > 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.
          > ...[/color]

          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.

          --
          Best regards,
          Andrey Tarasevich
          Brainbench C and C++ Programming MVP

          Comment

          Working...