Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1986

Status should not have non-trivial copy constructor or destructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.2
    • Impala 2.5.0
    • Backend

    Description

      Having either a non-trivial copy constructor or non-trivial destructor prevents Status from being passed (and returned) via registers, which is bad because it is used in so many places (and some places jump through hoops to avoid the various Status overheads). We should fix this so that passing around Status is as cheap as passing around a pointer (i.e. the single ErrorMsg* member).

      Doing so probably means we need a different scheme for managing the ErrorMsg memory (to avoid making copies/deletes on every Status copy).

      According to the x86-64 ABI 3.2.3 (http://www.x86-64.org/documentation/abi.pdf):

      2. If a C++ object has either a non-trivial copy constructor or a non-trivial
      destructor [11], it is passed by invisible reference (the object is replaced in the
      parameter list by a pointer that has class INTEGER) [12]

      11 A de/constructor is trivial if it is an implicitly-declared default de/constructor and if:
      • its class has no virtual functions and no virtual base classes, and
      • all the direct base classes of its class have trivial de/constructors, and
      • for all the nonstatic data members of its class that are of class type (or array thereof), each
      such class has a trivial de/constructor.

      12 An object with either a non-trivial copy constructor or a non-trivial destructor cannot be
      passed by value because such objects must have well defined addresses. Similar issues apply
      when returning an object from a function.

      Attachments

        Activity

          People

            kwho Michael Ho
            dhecht Daniel Hecht
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: