Make paged and non-paged memory pools 8-byte aligned.

svn path=/trunk/; revision=6390
This commit is contained in:
Eric Kohl 2003-10-20 18:43:11 +00:00
parent 2515e0e291
commit bf57d89032
3 changed files with 11 additions and 7 deletions

View file

@ -19,7 +19,12 @@ extern PVOID MmPagedPoolBase;
extern ULONG MmPagedPoolSize; extern ULONG MmPagedPoolSize;
#define MM_PAGED_POOL_SIZE (100*1024*1024) #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) * Maximum size of the kmalloc area (this is totally arbitary)

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -1573,8 +1573,7 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, ULONG Size, ULONG Tag, PVOID Caller)
KeReleaseSpinLock(&MmNpoolLock, oldIrql); KeReleaseSpinLock(&MmNpoolLock, oldIrql);
return(NULL); return(NULL);
} }
/* Make the size dword alligned, this makes the block dword alligned */
Size = ROUND_UP(Size, sizeof(DWORD));
if (Size >= PAGE_SIZE) if (Size >= PAGE_SIZE)
{ {
@ -1587,7 +1586,7 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, ULONG Size, ULONG Tag, PVOID Caller)
} }
else else
{ {
alignment = 0; alignment = MM_POOL_ALIGNMENT;
} }
best = get_block(Size, alignment); best = get_block(Size, alignment);

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -195,7 +195,7 @@ ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType,
} }
else else
{ {
Alignment = 0; Alignment = MM_POOL_ALIGNMENT;
} }
/* /*