Use symbolic constant for number of hash buckets and use it where appropriate (fixing one missing location).

svn path=/trunk/; revision=59592
This commit is contained in:
Timo Kreuzer 2013-07-28 13:54:42 +00:00
parent 1a7d645928
commit 6320fe5192
3 changed files with 8 additions and 7 deletions

View file

@ -45,7 +45,8 @@ extern HANDLE hBootstrapOk;
extern HANDLE CsrApiPort;
extern HANDLE CsrSmApiPort;
extern HANDLE CsrSbApiPort;
extern LIST_ENTRY CsrThreadHashTable[257];
#define NUMBER_THREAD_HASH_BUCKETS 257
extern LIST_ENTRY CsrThreadHashTable[NUMBER_THREAD_HASH_BUCKETS];
extern PCSR_PROCESS CsrRootProcess;
extern UNICODE_STRING CsrDirectoryName;
extern ULONG CsrDebug;

View file

@ -371,7 +371,7 @@ CsrInitializeProcessStructure(VOID)
CsrRootProcess->ClientId = NtCurrentTeb()->ClientId;
/* Initialize the Thread Hash List */
for (i = 0; i < 256; i++) InitializeListHead(&CsrThreadHashTable[i]);
for (i = 0; i < NUMBER_THREAD_HASH_BUCKETS; i++) InitializeListHead(&CsrThreadHashTable[i]);
/* Initialize the Wait Lock */
return RtlInitializeCriticalSection(&CsrWaitListsLock);

View file

@ -14,11 +14,11 @@
#define NDEBUG
#include <debug.h>
#define CsrHashThread(t) (HandleToUlong(t) % 257)
#define CsrHashThread(t) (HandleToUlong(t) % NUMBER_THREAD_HASH_BUCKETS)
/* GLOBALS ********************************************************************/
LIST_ENTRY CsrThreadHashTable[257];
LIST_ENTRY CsrThreadHashTable[NUMBER_THREAD_HASH_BUCKETS];
/* PRIVATE FUNCTIONS **********************************************************/