diff options
| author | Mark Eichin <eichin@mit.edu> | 1996-11-11 22:03:50 +0000 |
|---|---|---|
| committer | Mark Eichin <eichin@mit.edu> | 1996-11-11 22:03:50 +0000 |
| commit | 28208a459a7c3305dd2f7b0e4076b2cd74412bee (patch) | |
| tree | 5aaedfa852fe72a5caa38050c2e7d5d4e01e5faa /src/util/db2/hash | |
| parent | b4e07db1468aa2b627f2472c3c88bda0877ca009 (diff) | |
* db2: overflow_page fixes, __P redef
* db2 tests: better alternate dictionary support
(orignal ChangeLogs included)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9373 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/db2/hash')
| -rw-r--r-- | src/util/db2/hash/hash.h | 4 | ||||
| -rw-r--r-- | src/util/db2/hash/hash_page.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/util/db2/hash/hash.h b/src/util/db2/hash/hash.h index 973d543a8..a12c8d4c2 100644 --- a/src/util/db2/hash/hash.h +++ b/src/util/db2/hash/hash.h @@ -110,10 +110,10 @@ typedef struct htab { /* Memory resident data structure */ #define MIN_BUFFERS 6 #define MINHDRSIZE 512 #define DEF_CACHESIZE 65536 -#define DEF_BUCKET_SIZE 4096 #define DEF_BUCKET_SHIFT 12 /* log2(BUCKET) */ -#define DEF_SEGSIZE 256 +#define DEF_BUCKET_SIZE (1<<DEF_BUCKET_SHIFT) #define DEF_SEGSIZE_SHIFT 8 /* log2(SEGSIZE) */ +#define DEF_SEGSIZE (1<<DEF_SEGSIZE_SHIFT) #define DEF_DIRSIZE 256 #define DEF_FFACTOR 65536 #define MIN_FFACTOR 4 diff --git a/src/util/db2/hash/hash_page.c b/src/util/db2/hash/hash_page.c index 55acac81a..304b0fc8a 100644 --- a/src/util/db2/hash/hash_page.c +++ b/src/util/db2/hash/hash_page.c @@ -701,6 +701,8 @@ __add_ovflpage(hashp, pagep) hashp->hdr.ffactor = MIN_FFACTOR; } ovfl_num = overflow_page(hashp); + if (!ovfl_num) + return (NULL); if (__new_page(hashp, (u_int32_t)ovfl_num, A_OVFL) != 0) return (NULL); @@ -741,6 +743,8 @@ __add_bigpage(hashp, pagep, ndx, is_basepage) u_int16_t ovfl_num; ovfl_num = overflow_page(hashp); + if (!ovfl_num) + return (NULL); if (__new_page(hashp, (u_int32_t)ovfl_num, A_OVFL) != 0) return (NULL); @@ -1062,6 +1066,9 @@ first_free(map) return (i); } +/* + * returns 0 on error + */ static u_int16_t overflow_page(hashp) HTAB *hashp; |
