mdbx: avoid float-point ops in prev commit.

Change-Id: I7fadc5096f49502c01a60436840bb1a87dfe27bd
This commit is contained in:
Leonid Yuriev 2021-04-07 14:29:14 +03:00
parent c14e4235ee
commit 7f5cbf7dd8

View File

@ -10529,8 +10529,7 @@ __cold static intptr_t get_reasonable_db_maxsize(intptr_t *cached_result) {
assert(MAX_MAPSIZE >= (size_t)(total_ram_pages * pagesize * 2));
/* Suggesting should not be more than golden ratio of the size of RAM. */
*cached_result =
(intptr_t)(total_ram_pages * pagesize * 1.6180339887498948482);
*cached_result = (intptr_t)((size_t)total_ram_pages * 207 >> 7) * pagesize;
/* Round to the nearest human-readable granulation. */
for (int i = 10; i < MDBX_WORDBITS - 1; i += 10) {