--- trunk/reactos/ntoskrnl/mm/RPoolMgr.h 2005-01-12 15:35:12 UTC (rev 12971)
+++ trunk/reactos/ntoskrnl/mm/RPoolMgr.h 2005-01-12 16:09:12 UTC (rev 12972)
@@ -12,18 +12,17 @@
#define RPOOLMGR_H
typedef unsigned long rulong;
-typedef ULONG_PTR rulong_ptr;
-#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (rulong_ptr)(ptr) < ((rulong_ptr)pool->UserBase + pool->UserSize)
+#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize)
#define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) )
#define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz >= sizeof(R_FREE) && sz < pool->UserSize )
#ifndef R_ROUND_UP
-#define R_ROUND_UP(x,s) ((PVOID)(((rulong_ptr)(x)+(s)-1) & ~((rulong_ptr)(s)-1)))
+#define R_ROUND_UP(x,s) ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
#endif//R_ROUND_UP
#ifndef R_ROUND_DOWN
-#define R_ROUND_DOWN(x,s) ((PVOID)(((rulong_ptr)(x)) & ~((rulong_ptr)(s)-1)))
+#define R_ROUND_DOWN(x,s) ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
#endif//R_ROUND_DOWN
#ifndef R_QUEMIN
@@ -78,9 +77,9 @@
#endif//R_MAGIC
rulong PrevSize : 30;
rulong Status : 2;
- rulong_ptr Size;
+ rulong Size;
#if R_STACK
- rulong_ptr LastOwnerStack[R_STACK];
+ ULONG_PTR LastOwnerStack[R_STACK];
#endif//R_STACK
struct _R_FREE* NextFree;
struct _R_FREE* PrevFree;
@@ -94,9 +93,9 @@
#endif//R_MAGIC
rulong PrevSize : 30;
rulong Status : 2;
- rulong_ptr Size;
+ rulong Size;
#if R_STACK
- rulong_ptr LastOwnerStack[R_STACK];
+ ULONG_PTR LastOwnerStack[R_STACK];
#endif//R_STACK
struct _R_USED* NextUsed;
#if R_RZ
@@ -116,9 +115,9 @@
typedef struct _R_POOL
{
void* PoolBase;
- rulong_ptr PoolSize;
+ rulong PoolSize;
void* UserBase;
- rulong_ptr UserSize;
+ rulong UserSize;
rulong Alignments[3];
PR_FREE FirstFree, LastFree;
R_QUE Que[R_QUECOUNT][3];
@@ -148,7 +147,7 @@
#endif//R_STACK
static int
-RQueWhich ( rulong_ptr size )
+RQueWhich ( rulong size )
{
rulong que, quesize;
for ( que=0, quesize=16; que < R_QUECOUNT; que++, quesize<<=1 )
@@ -288,7 +287,7 @@
}
PR_POOL
-RPoolInit ( void* PoolBase, rulong_ptr PoolSize, int align1, int align2, int align3 )
+RPoolInit ( void* PoolBase, rulong PoolSize, int align1, int align2, int align3 )
{
int align, que;
PR_POOL pool = (PR_POOL)PoolBase;
@@ -568,7 +567,7 @@
}
static void
-RSetSize ( PR_POOL pool, PR_FREE Block, rulong_ptr NewSize, PR_FREE NextBlock )
+RSetSize ( PR_POOL pool, PR_FREE Block, rulong NewSize, PR_FREE NextBlock )
{
R_ASSERT_PTR(pool,Block);
ASSERT ( NewSize < pool->UserSize );
@@ -581,7 +580,7 @@
}
static PR_FREE
-RFreeSplit ( PR_POOL pool, PR_FREE Block, rulong_ptr NewSize )
+RFreeSplit ( PR_POOL pool, PR_FREE Block, rulong NewSize )
{
PR_FREE NewBlock = (PR_FREE)((char*)Block + NewSize);
RSetSize ( pool, NewBlock, Block->Size - NewSize, NULL );
@@ -655,7 +654,7 @@
#define RiUsedInitRedZone(Block,UserSize)
#else//R_RZ
static void
-RiUsedInitRedZone ( PR_USED Block, rulong_ptr UserSize )
+RiUsedInitRedZone ( PR_USED Block, rulong UserSize )
{
// write out buffer-overrun detection bytes
char* Addr = (char*)RHdrToBody(Block);
@@ -669,7 +668,7 @@
#endif//R_RZ
static void*
-RPoolAlloc ( PR_POOL pool, rulong_ptr NumberOfBytes, rulong Tag, rulong align )
+RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align )
{
PR_USED NewBlock;
PR_FREE BestBlock,
@@ -678,8 +677,10 @@
BestPreviousBlock,
CurrentBlock;
void* BestAlignedAddr;
- rulong_ptr que, queBytes = NumberOfBytes;
- rulong BlockSize, Alignment;
+ int que,
+ queBytes = NumberOfBytes;
+ rulong BlockSize,
+ Alignment;
int que_reclaimed = 0;
ASSERT ( pool );