mongo/docs/memory_management.md
Daniel Moody e54f728ad4 SERVER-103927 switch from scons to bazel (#39284)
GitOrigin-RevId: 698b83c9b64adf5dfe2b670d16052f24342c04e3
2025-07-29 17:50:19 +00:00

359 B

Memory Management

  • Avoid using bare pointers for dynamically allocated objects. Prefer std::unique_ptr, std::shared_ptr, or another RAII class such as BSONObj.
  • If you assign the output of new/malloc() directly to a bare pointer you should document where it gets deleted/freed, who owns it along the way, and how exception safety is ensured.