xref: /freebsd/crypto/krb5/src/plugins/kdb/db2/libdb2/hash/page.h.patch (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert*** /tmp/,RCSt1a21720	Wed Apr  3 11:49:55 1996
2*7f2fe78bSCy Schubert--- page.h	Wed Apr  3 08:42:25 1996
3*7f2fe78bSCy Schubert***************
4*7f2fe78bSCy Schubert*** 158,163
5*7f2fe78bSCy Schubert
6*7f2fe78bSCy Schubert  #define PAIRFITS(P,K,D)	((PAIRSIZE((K),(D))) <= FREESPACE((P)))
7*7f2fe78bSCy Schubert  #define BIGPAIRFITS(P)	((FREESPACE((P)) >= PAIR_OVERHEAD))
8*7f2fe78bSCy Schubert  #define FREESPACE(P) \
9*7f2fe78bSCy Schubert  	((OFFSET((P)) - PAGE_OVERHEAD - (NUM_ENT((P)) * PAIR_OVERHEAD)))
10*7f2fe78bSCy Schubert
11*7f2fe78bSCy Schubert
12*7f2fe78bSCy Schubert--- 158,169 -----
13*7f2fe78bSCy Schubert
14*7f2fe78bSCy Schubert  #define PAIRFITS(P,K,D)	((PAIRSIZE((K),(D))) <= FREESPACE((P)))
15*7f2fe78bSCy Schubert  #define BIGPAIRFITS(P)	((FREESPACE((P)) >= PAIR_OVERHEAD))
16*7f2fe78bSCy Schubert+ /*
17*7f2fe78bSCy Schubert+  * Since these are all unsigned, we need to guarantee that we never go
18*7f2fe78bSCy Schubert+  * negative.  Offset values are 0-based and overheads are one based (i.e.
19*7f2fe78bSCy Schubert+  * one byte of overhead is 1, not 0), so we need to convert OFFSETs to
20*7f2fe78bSCy Schubert+  * 1-based counting before subtraction.
21*7f2fe78bSCy Schubert+  */
22*7f2fe78bSCy Schubert  #define FREESPACE(P) \
23*7f2fe78bSCy Schubert  	((OFFSET((P)) + 1 - PAGE_OVERHEAD - (NUM_ENT((P)) * PAIR_OVERHEAD)))
24*7f2fe78bSCy Schubert
25*7f2fe78bSCy Schubert***************
26*7f2fe78bSCy Schubert*** 159,165
27*7f2fe78bSCy Schubert  #define PAIRFITS(P,K,D)	((PAIRSIZE((K),(D))) <= FREESPACE((P)))
28*7f2fe78bSCy Schubert  #define BIGPAIRFITS(P)	((FREESPACE((P)) >= PAIR_OVERHEAD))
29*7f2fe78bSCy Schubert  #define FREESPACE(P) \
30*7f2fe78bSCy Schubert! 	((OFFSET((P)) - PAGE_OVERHEAD - (NUM_ENT((P)) * PAIR_OVERHEAD)))
31*7f2fe78bSCy Schubert
32*7f2fe78bSCy Schubert  /*
33*7f2fe78bSCy Schubert   * Overhead on header pages is just one word -- the length of the
34*7f2fe78bSCy Schubert
35*7f2fe78bSCy Schubert--- 165,171 -----
36*7f2fe78bSCy Schubert   * 1-based counting before subtraction.
37*7f2fe78bSCy Schubert   */
38*7f2fe78bSCy Schubert  #define FREESPACE(P) \
39*7f2fe78bSCy Schubert! 	((OFFSET((P)) + 1 - PAGE_OVERHEAD - (NUM_ENT((P)) * PAIR_OVERHEAD)))
40*7f2fe78bSCy Schubert
41*7f2fe78bSCy Schubert  /*
42*7f2fe78bSCy Schubert   * Overhead on header pages is just one word -- the length of the
43