Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-85835

Construct boost::optional and std::unique_ptr decorations by zero-initing

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch
    • Fully Compatible
    • Service Arch 2024-02-19, Service Arch 2024-03-04, Service Arch 2024-03-18, Service Arch 2024-04-01

      Breaking this portion out from SERVER-81848:

      We can assume that zero-init is good enough for some types that aren't trivial init, such as boost::optional (safer since we control the definition) and std::unique_ptr<T> with no custom deleter (slightly more risky since the definition is provided by the toolchain, however it is hard to imagine a practical implementation where zero filling isn't correct, and our tests would explode if it wasn't)

            Assignee:
            alex.li@mongodb.com Alex Li
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: