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

[C++] MemoryManager::AllocateBuffer should return unique_ptr

    XMLWordPrintableJSON

Details

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

    Description

      MemoryManager::AllocateBuffer currently returns shared_ptr<Buffer>, but analogously to arrow::AllocateBuffer, it should probably return unique_ptr<Buffer>. Also, we can convert a unique_ptr to a shared_ptr but not the other way around.

      This would be a breaking change in a core API, though. I think this API is not used much, given it is relatively new, but we should keep this in mind.

      (Context: for the Flight/UCX prototype, I'm trying to integrate MemoryManager support given UCX can transparently handle some types of non-CPU memory, but while I've used mostly unique_ptr so far, MemoryManager uses shared_ptr which did cause a small snag.)

      Attachments

        Issue Links

          Activity

            People

              lidavidm David Li
              lidavidm David Li
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 1.5h
                  1.5h