mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 04:26:32 +00:00
[NTOS:MM] Fix integer arithmetics
This commit is contained in:
parent
4cd92f0d01
commit
d1d1260f5f
1 changed files with 2 additions and 4 deletions
|
@ -29,8 +29,6 @@
|
|||
* etc.
|
||||
*/
|
||||
#define POOL_BIG_TABLE_USE_RATE 4
|
||||
#define POOL_BIG_TABLE_LOW_THRESHOLD (POOL_BIG_TABLE_USE_RATE * 2)
|
||||
#define POOL_BIG_TABLE_HIGH_THRESHOLD ((POOL_BIG_TABLE_USE_RATE - 1) / POOL_BIG_TABLE_USE_RATE)
|
||||
|
||||
typedef struct _POOL_DPC_CONTEXT
|
||||
{
|
||||
|
@ -1636,7 +1634,7 @@ Retry:
|
|||
// which implies a massive number of concurrent big pool allocations.
|
||||
//
|
||||
ExpPoolBigEntriesInUse++;
|
||||
if ((i >= 16) && (ExpPoolBigEntriesInUse > (TableSize * POOL_BIG_TABLE_HIGH_THRESHOLD)))
|
||||
if ((i >= 16) && (ExpPoolBigEntriesInUse > (TableSize * (POOL_BIG_TABLE_USE_RATE - 1) / POOL_BIG_TABLE_USE_RATE)))
|
||||
{
|
||||
DPRINT("Attempting expansion since we now have %lu entries\n",
|
||||
ExpPoolBigEntriesInUse);
|
||||
|
@ -1750,7 +1748,7 @@ ExpFindAndRemoveTagBigPages(IN PVOID Va,
|
|||
|
||||
/* If reaching 12.5% of the size (or whatever integer rounding gets us to),
|
||||
* halve the allocation size, which will get us to 25% of space used. */
|
||||
if (ExpPoolBigEntriesInUse < (PoolBigPageTableSize / POOL_BIG_TABLE_LOW_THRESHOLD))
|
||||
if (ExpPoolBigEntriesInUse < (PoolBigPageTableSize / (POOL_BIG_TABLE_USE_RATE * 2)))
|
||||
{
|
||||
/* Shrink the table. */
|
||||
ExpReallocateBigPageTable(OldIrql, TRUE);
|
||||
|
|
Loading…
Reference in a new issue