|
From: Andre R. <and...@us...> - 2004-11-24 20:48:30
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15457/Common/source Modified Files: Tag: New_Tables_Experiment-branch langhash.c tablevalidate.c Log Message: Retired flv10tables pre-processor definition. Code that was ifdef'd for it has been permanently enabled. We are going to make more changes soon that require the new code, but ifdef'ing the new stuff as well would be too complex. Index: tablevalidate.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/tablevalidate.c,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -C2 -d -r1.3.2.4 -r1.3.2.5 *** tablevalidate.c 15 Nov 2004 22:43:07 -0000 1.3.2.4 --- tablevalidate.c 24 Nov 2004 20:48:17 -0000 1.3.2.5 *************** *** 122,126 **** } - #ifdef flv10tables if (hashfunction (bs) != (**x).hashval) { --- 122,125 ---- *************** *** 138,150 **** return (false); } - #else - if (hashfunction (bs) != i) { - - if (flalert) - shellinternalerror (idbadbucketliststring, "\x1b" "bad string in a bucket list"); - - return (false); - } - #endif if (!gettablevariable ((**x).val, &hvariable, &errcode)) --- 137,140 ---- Index: langhash.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langhash.c,v retrieving revision 1.4.2.16 retrieving revision 1.4.2.17 diff -C2 -d -r1.4.2.16 -r1.4.2.17 *** langhash.c 21 Nov 2004 20:15:26 -0000 1.4.2.16 --- langhash.c 24 Nov 2004 20:48:17 -0000 1.4.2.17 *************** *** 163,167 **** ! #if defined(flv10tables) && defined (flrecyclehashbuckets) /* --- 163,167 ---- ! #ifdef flrecyclehashbuckets /* *************** *** 438,503 **** ! #ifdef flv10tables ! ! static boolean newhashbucketarray (unsigned long logsize, hdlhashbucketarray *hbuckets) { ! ! #ifdef flrecyclehashbuckets ! ! assert (logsize >= ctinitiallogsize); ! ! if (logsize < maxfreebucketlogsize) { ! ! hdlhashbucketarray hb = hfreebuckets[logsize]; ! if (hb != nil) { ! ! hfreebuckets[logsize] = (hdlhashbucketarray) (*hb)[0]; ! assert (gethandlesize ((Handle) hb) == (1 << logsize) * sizeof (hdlhashnode)); ! clearhandle ((Handle) hb); ! *hbuckets = hb; ! #ifdef fldebug ! hdebughashbucketsrecycled[logsize]++; ! #endif ! return (true); ! } #ifdef fldebug ! hdebughashbucketsallocated[logsize]++; #endif } - #endif ! return (newclearhandle ((1 << logsize) * sizeof (hdlhashnode), (Handle *) hbuckets)); ! } /*newhashbucketarray*/ - static void disposehashbucketarray (unsigned long logsize, hdlhashbucketarray hb) { - - #ifdef flrecyclehashbuckets ! assert (logsize >= ctinitiallogsize); ! if (logsize < maxfreebucketlogsize) { ! ! assert (gethandlesize ((Handle) hb) == (1 << logsize) * sizeof (hdlhashnode)); ! (*hb)[0] = (hdlhashnode) hfreebuckets[logsize]; ! hfreebuckets[logsize] = hb; ! return; ! } ! ! #endif ! disposehandle ((Handle) hb); ! } /*disposehashbucketarray*/ ! #endif --- 438,499 ---- ! static boolean newhashbucketarray (unsigned long logsize, hdlhashbucketarray *hbuckets) { ! ! #ifdef flrecyclehashbuckets ! ! assert (logsize >= ctinitiallogsize); ! if (logsize < maxfreebucketlogsize) { ! hdlhashbucketarray hb = hfreebuckets[logsize]; ! if (hb != nil) { ! ! hfreebuckets[logsize] = (hdlhashbucketarray) (*hb)[0]; ! assert (gethandlesize ((Handle) hb) == (1 << logsize) * sizeof (hdlhashnode)); ! clearhandle ((Handle) hb); ! *hbuckets = hb; #ifdef fldebug ! hdebughashbucketsrecycled[logsize]++; #endif + + return (true); } ! #ifdef fldebug ! hdebughashbucketsallocated[logsize]++; ! #endif ! } ! #endif + return (newclearhandle ((1 << logsize) * sizeof (hdlhashnode), (Handle *) hbuckets)); + } /*newhashbucketarray*/ ! static void disposehashbucketarray (unsigned long logsize, hdlhashbucketarray hb) { ! ! #ifdef flrecyclehashbuckets ! assert (logsize >= ctinitiallogsize); ! if (logsize < maxfreebucketlogsize) { ! ! assert (gethandlesize ((Handle) hb) == (1 << logsize) * sizeof (hdlhashnode)); ! (*hb)[0] = (hdlhashnode) hfreebuckets[logsize]; ! hfreebuckets[logsize] = hb; ! return; ! } ! ! #endif ! disposehandle ((Handle) hb); ! } /*disposehashbucketarray*/ *************** *** 523,530 **** hdlhashtable ht; ! #ifdef flv10tables ! hdlhashbucketarray hbuckets; ! unsigned long logsize = ctinitiallogsize; ! #endif #ifdef fltablesortorderisarray hdllist hsort; --- 519,524 ---- hdlhashtable ht; ! hdlhashbucketarray hbuckets; ! unsigned long logsize = ctinitiallogsize; #ifdef fltablesortorderisarray hdllist hsort; *************** *** 592,597 **** #endif - #ifdef flv10tables - if (!newhashbucketarray (logsize, &hbuckets)) { --- 586,589 ---- *************** *** 612,617 **** (**ht).bucketmask = (1 << logsize) - 1; - - #endif (**ht).timecreated = timenow (); --- 604,607 ---- *************** *** 623,628 **** - #ifdef flv10tables - static unsigned long ctresizedhashtables = 0; --- 613,616 ---- *************** *** 688,693 **** return (true); } /*resizehashtable*/ - - #endif /*flv10tables*/ --- 676,679 ---- *************** *** 1198,1206 **** dirtyhashtable (ht); - #ifdef flv10tables assert ((**ht).ctnodes == ctdisposed); (**ht).ctnodes = 0; - #endif return (ctdisposed); --- 1184,1190 ---- *************** *** 1269,1277 **** #endif - #ifdef flv10tables disposehashbucketarray ((**ht).logsize, (**ht).hbuckets); (**ht).hbuckets = nil; - #endif (**ht).prevhashtable = hfirstfreetable; /*queue for recycling*/ --- 1253,1259 ---- *************** *** 1283,1288 **** - #ifdef flv10tables - #if 0 --- 1265,1268 ---- *************** *** 1408,1412 **** #endif ! #else long hashfunction (const bigstring bs) { --- 1388,1392 ---- #endif ! #if 0 long hashfunction (const bigstring bs) { *************** *** 1437,1441 **** } /*hashfunction*/ ! #endif /*flv10tables*/ --- 1417,1421 ---- } /*hashfunction*/ ! #endif *************** *** 1565,1570 **** register hdlhashnode hnext; - #ifdef flv10tables - //if ((**htable).ctnodes > (1 << (**htable).logsize)) if (3 * (**htable).ctnodes > 2 * (1 << (**htable).logsize)) --- 1545,1548 ---- *************** *** 1589,1598 **** ixbucket = hashtobucketindex (ht, (**hn).hashval); - #else - - ixbucket = hashfunction ((**hn).hashkey); - - #endif - hnext = nthhashbucket (ht, ixbucket); --- 1567,1570 ---- *************** *** 1601,1609 **** (**hn).hashlink = hnext; - #ifdef flv10tables - (**htable).ctnodes++; - - #endif return (true); --- 1573,1577 ---- *************** *** 1677,1686 **** (**prev).hashlink = (**nomad).hashlink; - #ifdef flv10tables - (**htable).ctnodes--; - #endif - return (true); } /*hashunlinknode*/ --- 1645,1650 ---- *************** *** 1707,1713 **** hashunlinknode (htable, hnode); - #ifdef flv10tables (**hnode).hashval = hashfunction (bs); /*keep in sync with hashkey*/ - #endif copystring (bs, (**hnode).hashkey); --- 1671,1675 ---- *************** *** 1770,1776 **** #endif - #ifdef flv10tables (**hn).hashval = hashfunction (bskey); /*cache for re-use*/ - #endif copystring (bskey, (**hn).hashkey); --- 1732,1736 ---- *************** *** 1915,1923 **** */ - #ifdef flv10tables ixbucket = hashtobucketindex (currenthashtable, hashfunction (bs)); - #else - ixbucket = hashfunction (bs); - #endif //assert (currenthashtable != nil); --- 1875,1879 ---- *************** *** 1975,1996 **** if (hprev == nil) { - #ifdef flv10tables - assert ((**hn).hashval == hashfunction (bs)); nthhashbucket (currenthashtable, hashtobucketindex (currenthashtable, (**hn).hashval)) = (**hn).hashlink; - - #else - - nthhashbucket (currenthashtable, hashfunction (bs)) = (**hn).hashlink; - - #endif } else (**hprev).hashlink = (**hn).hashlink; - #ifdef flv10tables (**currenthashtable).ctnodes--; - #endif hashsorteddelete (hn); --- 1931,1942 ---- *************** *** 4109,4140 **** */ ! #ifdef flv10tables ! ! *ctitems = (**htable).ctnodes; ! ! #else ! ! #ifdef fltablesortorderisarray ! *ctitems = listcount ((**htable).hsortedlist); ! #else ! ! register hdlhashnode nomad = (**htable).hfirstsort; ! register long ct = 0; ! while (nomad != nil) { ! ! ct++; ! ! nomad = (**nomad).sortedlink; ! } /*while*/ ! ! *ctitems = ct; ! ! #endif ! ! #endif return (true); } /*hashcountitems*/ --- 4055,4074 ---- */ ! /* ! register hdlhashnode nomad = (**htable).hfirstsort; ! register long ct = 0; ! while (nomad != nil) { ! ct++; ! nomad = (**nomad).sortedlink; ! } /%while%/ ! ! *ctitems = ct; ! */ + *ctitems = (**htable).ctnodes; + return (true); } /*hashcountitems*/ |