Commit ee6f7515 authored by Peter Pentchev's avatar Peter Pentchev
Browse files

Add the decrease-numblocks patch.

Fix the allocation defaults on 32-bit systems that report a lot of
available memory.
parent 4f2db58f
Description: Do not try to allocate more than the available memory.
Forwarded: no
Author: Peter Pentchev <roam@ringlet.net>
Last-Update: 2020-11-04
--- a/mbuffer.c
+++ b/mbuffer.c
@@ -1019,6 +1019,11 @@
Blocksize = PgSz;
debugmsg("Blocksize set to physical page size of %ld bytes\n",PgSz);
Numblocks = NumP/50;
+ if ((Blocksize * (long long)Numblocks) > (long long)SSIZE_MAX) {
+ debugmsg("Cannot allocate that many blocks");
+ while ((Blocksize * (long long)Numblocks) > (long long)SSIZE_MAX)
+ Numblocks >>= 1;
+ }
long mxsemv = maxSemValue();
while ((Numblocks > mxsemv) || (Numblocks > 200)) {
Numblocks >>= 1;
......@@ -7,3 +7,4 @@ libmhash-so-version.patch
cppflags.patch
build-stamp.patch
cross.patch
decrease-numblocks.patch
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment