Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-12530

[C++] Remove Buffer::mutable_data_ member and use const_cast on data_ only if is_mutable_ is true

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0
    • C++

    Description

      Proposed new implementation of mutable_data() by apitrou

        uint8_t* mutable_data() {
           return is_mutable() ? const_cast<uint8_t*>(data()) : nullptr;
         }
      

      This will help avoid various classes of bugs (initializing Buffer subclasses incorrectly) and make the object smaller on the heap

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              wesm Wes McKinney
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m