Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864333
D8742.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
880 B
Subscribers
None
D8742.diff
View Options
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
Details
Attached
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)
Attached To
D8742: Add a constant for the maximum vector allocation (5 Mbyte)
Event Timeline
Log In to Comment