diff --git a/reactos/ntoskrnl/include/internal/pool.h b/reactos/ntoskrnl/include/internal/pool.h index e16a0f52369..e3be1baa0c0 100644 --- a/reactos/ntoskrnl/include/internal/pool.h +++ b/reactos/ntoskrnl/include/internal/pool.h @@ -19,7 +19,12 @@ extern PVOID MmPagedPoolBase; extern ULONG MmPagedPoolSize; #define MM_PAGED_POOL_SIZE (100*1024*1024) -#define MM_NONPAGED_POOL_SIZE (100*1024*1024) +#define MM_NONPAGED_POOL_SIZE (100*1024*1024) + +/* + * Paged and non-paged pools are 8-byte aligned + */ +#define MM_POOL_ALIGNMENT 8 /* * Maximum size of the kmalloc area (this is totally arbitary) diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index 2d7354f4f39..8b200f8bf97 100644 --- a/reactos/ntoskrnl/mm/npool.c +++ b/reactos/ntoskrnl/mm/npool.c @@ -1,4 +1,4 @@ -/* $Id: npool.c,v 1.75 2003/09/14 09:14:20 hbirr Exp $ +/* $Id: npool.c,v 1.76 2003/10/20 18:43:11 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1573,8 +1573,7 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, ULONG Size, ULONG Tag, PVOID Caller) KeReleaseSpinLock(&MmNpoolLock, oldIrql); return(NULL); } - /* Make the size dword alligned, this makes the block dword alligned */ - Size = ROUND_UP(Size, sizeof(DWORD)); + if (Size >= PAGE_SIZE) { @@ -1587,7 +1586,7 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, ULONG Size, ULONG Tag, PVOID Caller) } else { - alignment = 0; + alignment = MM_POOL_ALIGNMENT; } best = get_block(Size, alignment); diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index 458d6c4bd7f..d70337f849c 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -1,4 +1,4 @@ -/* $Id: ppool.c,v 1.20 2003/10/12 17:05:48 hbirr Exp $ +/* $Id: ppool.c,v 1.21 2003/10/20 18:43:11 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -195,7 +195,7 @@ ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, } else { - Alignment = 0; + Alignment = MM_POOL_ALIGNMENT; } /*