summaryrefslogtreecommitdiff
path: root/docs/memory_management.md
diff options
context:
space:
mode:
authorIan Whalen <ian@mongodb.com>2020-02-12 12:21:17 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-17 13:12:40 +0000
commitfb26a7fb81b1c6986ebfebbdd9289297fbfd16aa (patch)
treed9ef620121fe920a02cced87643e7a3a99e77c60 /docs/memory_management.md
parentaa1ee1001b9a7ae5822b01c6378402cbc9f1d1e8 (diff)
downloadmongo-fb26a7fb81b1c6986ebfebbdd9289297fbfd16aa.tar.gz
SERVER-37414 Move branch-specific docs from GitHub Wiki into repo
Diffstat (limited to 'docs/memory_management.md')
-rw-r--r--docs/memory_management.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/memory_management.md b/docs/memory_management.md
new file mode 100644
index 00000000000..5363f7aff25
--- /dev/null
+++ b/docs/memory_management.md
@@ -0,0 +1,6 @@
+# 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.