changed shorts back to ints.
authorDennis Glatting <dennisg@gnu.org>
Sun, 24 Nov 1991 01:20:02 +0000 (01:20 +0000)
committerDennis Glatting <dennisg@gnu.org>
Sun, 24 Nov 1991 01:20:02 +0000 (01:20 +0000)
the efficiency gained didn't out weight the grossness of the code.

From-SVN: r69

gcc/objc/hash.c
gcc/objc/hash.h

index 3bef4f8535d708dd21582710fd15ab7a283e621f..36b735c0046882544cca85b83b4a506be6ff1ba7 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  * 
-  $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/hash.c,v 0.6 1991/11/21 22:27:06 dennisg Exp dennisg $
+  $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/hash.c,v 0.7 1991/11/23 22:18:29 dennisg Exp dennisg $
   $Author: dennisg $
-  $Date: 1991/11/21 22:27:06 $
+  $Date: 1991/11/23 22:18:29 $
   $Log: hash.c,v $
+ * Revision 0.7  1991/11/23  22:18:29  dennisg
+ * deleted hashIndex() and moved it to hash-inline.h
+ * converted hash_value_for_key() to a inline and moved it to hash-inline.h.
+ *
  * Revision 0.6  1991/11/21  22:27:06  dennisg
  * changed hash value calculation.
  * func name changed from hashValue() to hashIndex().  the
@@ -117,7 +121,7 @@ void hash_delete( Cache_t theCache ) {
 
 void hash_add( Cache_t* theCache, void* aKey, void* aValue ) {
 
-  u_short     indx = hashIndex( *theCache, aKey );
+  u_int       indx = hashIndex( *theCache, aKey );
   CacheNode_t aCacheNode = calloc( 1, sizeof( CacheNode ));
 
 
@@ -189,7 +193,7 @@ void hash_add( Cache_t* theCache, void* aKey, void* aValue ) {
 
 void hash_remove( Cache_t theCache, void* aKey ) {
 
-  u_short     indx = hashIndex( theCache, aKey );
+  u_int       indx = hashIndex( theCache, aKey );
   CacheNode_t aCacheNode = ( *theCache->theNodeTable )[ indx ];
   
   
index 672fb75a160a20671313311618e92947bf7125ff..122e1c0e0c3b141939321a44fc7d945dcdbc7a95 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  * 
-  $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/hash.h,v 0.4 1991/11/21 22:25:19 dennisg Exp dennisg $
+  $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/hash.h,v 0.5 1991/11/23 22:19:21 dennisg Exp dennisg $
   $Author: dennisg $
-  $Date: 1991/11/21 22:25:19 $
+  $Date: 1991/11/23 22:19:21 $
   $Log: hash.h,v $
+ * Revision 0.5  1991/11/23  22:19:21  dennisg
+ * converted some entries in the hash structure from ints to shorts.
+ * this was done to use a less expensive division instruction
+ * in the hashIndex() routine.
+ *
  * Revision 0.4  1991/11/21  22:25:19  dennisg
  * deleted hash mask information from hash struct.
  * changed hashing algorithm.  those values are no longer needed.
@@ -93,7 +98,7 @@ typedef struct cache {
         * Variables used to track the size of the hash
         *      table so to determine when to resize it.
         */
-  u_short     sizeOfHash,                         /* Number of buckets 
+  u_int       sizeOfHash,                         /* Number of buckets 
                                                     allocated for the hash
                                                     table (number of array
                                                     entries allocated for