summaryrefslogtreecommitdiff
path: root/src/mongo/bson/mutable
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2014-04-09 12:09:05 -0400
committerAndrew Morrow <acm@mongodb.com>2014-04-09 16:53:28 -0400
commitef255438ebac75bb2058c12f32a926d46421c692 (patch)
tree061441d653cd7feb271e1c1758b29bfa7e05c3a7 /src/mongo/bson/mutable
parente5be760537665a25da2bc632a111859f1b8bbf79 (diff)
downloadmongo-ef255438ebac75bb2058c12f32a926d46421c692.tar.gz
SERVER-13523 Use a tiny number of fast reps in debug builds
Diffstat (limited to 'src/mongo/bson/mutable')
-rw-r--r--src/mongo/bson/mutable/document.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/bson/mutable/document.cpp b/src/mongo/bson/mutable/document.cpp
index 1f8018b0332..eed0640a509 100644
--- a/src/mongo/bson/mutable/document.cpp
+++ b/src/mongo/bson/mutable/document.cpp
@@ -399,8 +399,14 @@ namespace mutablebson {
// The designated field name for the root element.
const char kRootFieldName[] = "";
- // How many reps do we cache before we spill to heap. Use a power of two.
+ // How many reps do we cache before we spill to heap. Use a power of two. For debug
+ // builds we make this very small so it is less likely to mask vector invalidation
+ // logic errors. We don't make it zero so that we do execute the fastRep code paths.
+#if defined(_DEBUG)
+ const size_t kFastReps = 2;
+#else
const size_t kFastReps = 128;
+#endif
// An ElementRep contains the information necessary to locate the data for an Element,
// and the topology information for how the Element is related to other Elements in the