Skip to content

Commit 95d9224

Browse files
committed
[NTOS:MM] Replace a useless alignment with an ASSERT
All system space mappings are 64k aligned.
1 parent 7f8920b commit 95d9224

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ntoskrnl/mm/ARM3/section.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,10 @@ MiInsertInSystemSpace(IN PMMSESSION Session,
373373

374374
/* Compute the base address */
375375
Base = (PVOID)((ULONG_PTR)Session->SystemSpaceViewStart + (i * MI_SYSTEM_VIEW_BUCKET_SIZE));
376+
NT_ASSERT(((ULONG_PTR)Base & (MI_SYSTEM_VIEW_BUCKET_SIZE - 1)) == 0);
376377

377378
/* Get the hash entry for this allocation */
378-
Entry = ((ULONG_PTR)Base & ~(MI_SYSTEM_VIEW_BUCKET_SIZE - 1)) + Buckets;
379+
Entry = (ULONG_PTR)Base + Buckets;
379380
Hash = (Entry >> 16) % Session->SystemSpaceHashKey;
380381

381382
/* Loop hash entries until a free one is found */

0 commit comments

Comments
 (0)