mirror of
				https://github.com/isar/libmdbx.git
				synced 2025-10-31 03:29:01 +08:00 
			
		
		
		
	mdbx: avoid float-point ops in prev commit.
Change-Id: I7fadc5096f49502c01a60436840bb1a87dfe27bd
This commit is contained in:
		| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user