https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d1d1260f5f59046842707…
commit d1d1260f5f590468427077755d6f121a756e7738
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Mon Mar 22 10:01:39 2021 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Mon Mar 22 10:02:12 2021 +0100
[NTOS:MM] Fix integer arithmetics
---
ntoskrnl/mm/ARM3/expool.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/expool.c b/ntoskrnl/mm/ARM3/expool.c
index 4df9bbde217..74393137162 100644
--- a/ntoskrnl/mm/ARM3/expool.c
+++ b/ntoskrnl/mm/ARM3/expool.c
@@ -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);