Always pass MongoExtensionByteView by value in the public API

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      finley.lau@mongodb.com and I were just discussing the MongoExtensionByteView – should it be passed by value or by const-pointer when passed across the API? santiago.roche@mongodb.com  originally passed by value, but we've introduced some changes recently that pass by const-pointer.

      Verdict is: pass by value. Even though it requires a copy of the struct, the struct is only 16 bytes so copying should be cheap, and passing by value enforces the read-only nature of the struct. If you want more explanation, here is the validation I got from Gemini

      This ticket should go back and clean up some cases where we're passing by const pointer.

            Assignee:
            Alyssa Clark
            Reporter:
            Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: