Page MenuHomePhabricator

D8742.diff
No OneTemporary

D8742.diff

diff --git a/src/serialize.h b/src/serialize.h
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -25,6 +25,12 @@
static const uint64_t MAX_SIZE = 0x02000000;
+/**
+ * Maximum amount of memory (in bytes) to allocate at once when deserializing
+ * vectors.
+ */
+static const unsigned int MAX_VECTOR_ALLOCATE = 5000000;
+
/**
* Dummy data type to identify deserializing constructors.
*
@@ -866,7 +872,7 @@
size_t i = 0;
size_t nMid = 0;
while (nMid < nSize) {
- nMid += 5000000 / sizeof(T);
+ nMid += MAX_VECTOR_ALLOCATE / sizeof(T);
if (nMid > nSize) {
nMid = nSize;
}
@@ -938,7 +944,7 @@
size_t i = 0;
size_t nMid = 0;
while (nMid < nSize) {
- nMid += 5000000 / sizeof(T);
+ nMid += MAX_VECTOR_ALLOCATE / sizeof(T);
if (nMid > nSize) {
nMid = nSize;
}

File Metadata

Mime Type
text/plain
Expires
Tue, May 20, 18:51 (2 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5865727
Default Alt Text
D8742.diff (880 B)

Event Timeline