|
From: Andre R. <and...@us...> - 2004-11-20 19:09:15
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2058/Common/source Modified Files: Tag: New_Tables_Experiment-branch shellsysverbs.c Log Message: Added kernel implementation of Frontier.testHashFunction and Frontier.hashTableStats. Extended the Frontier.reclaimMemory verb to also flush the cache of lists. Index: shellsysverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellsysverbs.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** shellsysverbs.c 27 Oct 2004 18:57:55 -0000 1.3 --- shellsysverbs.c 20 Nov 2004 19:08:52 -0000 1.3.2.1 *************** *** 161,164 **** --- 161,168 ---- isvalidserialnumberfunc, + + hashtablestatsfunc, + + testhashfunctionfunc, ctfrontierverbs *************** *** 795,799 **** extern long fullpathloopcount; ! extern boolean hashstatsverb (tyvaluerecord *v); static boolean frontierfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { --- 799,803 ---- extern long fullpathloopcount; ! //extern boolean hashstatsverb (tyvaluerecord *v); static boolean frontierfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { *************** *** 929,932 **** --- 933,938 ---- hashflushcache (&ctbytes); + + listflushcache (&ctbytes); //2004-11-20 aradke return (setlongvalue (longinfinity - ctbytes, v)); *************** *** 983,987 **** --- 989,1029 ---- return (true); } + + case hashtablestatsfunc: { + + hdlhashtable htable; + + flnextparamislast = true; + + if (!gettablevalue (hparam1, 1, &htable)) + return (false); + + return (hashtablestatsverb (htable, v)); + } + + case testhashfunctionfunc: { + + bigstring bskey; + unsigned long ticks, hashval; + long k, kmax; + + if (!getstringvalue (hparam1, 1, bskey)) + return (false); + + flnextparamislast = true; + + if (!getlongvalue (hparam1, 2, &kmax)) + return (false); + ticks = gettickcount (); + + for (k = 0; k < kmax; k++) + hashval = hashfunction (bskey) & 0x000000ff; + + ticks = gettickcount () - ticks; + + return (setlongvalue (ticks, v)); + } + default: return (false); |