From b4b0ca19b19796bb2dcfc9a786ae3934054f73b4 Mon Sep 17 00:00:00 2001 From: scw Date: Sun, 22 Aug 2004 04:28:03 +0000 Subject: USHM checking bug. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2165 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/pttstruct.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/pttstruct.h b/include/pttstruct.h index ce58a08e..9d1b1935 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -368,7 +368,10 @@ typedef struct keeploc_t { struct keeploc_t *next; } keeploc_t; -#define USHM_SIZE (MAX_ACTIVE + 4) /* why+4? */ +#define VALID_USHM_ENTRY(X) ((X) >= 0 && (X) < USHM_SIZE) +#define USHM_SIZE (MAX_ACTIVE + 4) +/* USHM_SIZE 比 MAX_ACTIVE 大是為了防止檢查人數上限時, 又同時衝進來 + * 會造成找 shm 空位的無窮迴圈. 又, 因 USHM 中用 hash, 空間稍大時效率較好. */ /* MAX_BMs is dirty hardcode 4 in mbbsd/cache.c:is_BM_cache() */ #define MAX_BMs 4 /* for BMcache, 一個看板最多幾板主 */ -- cgit v1.2.3