ICU-5955 Better bit packing of the hash table as reported by Purify.

X-SVN-Rev: 23102
This commit is contained in:
George Rhoten 2007-12-17 22:12:44 +00:00
parent 075829e0f3
commit 5bb343c749

View File

@ -1,6 +1,6 @@
/* /*
****************************************************************************** ******************************************************************************
* Copyright (C) 1997-2006, International Business Machines * Copyright (C) 1997-2007, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
****************************************************************************** ******************************************************************************
* Date Name Description * Date Name Description
@ -173,8 +173,6 @@ struct UHashtable {
* never let count == length (see code). */ * never let count == length (see code). */
int32_t length; /* The physical size of the arrays hashes, keys int32_t length; /* The physical size of the arrays hashes, keys
* and values. Must be prime. */ * and values. Must be prime. */
int32_t primeIndex; /* Index into our prime table for length.
* length == PRIMES[primeIndex] */
/* Rehashing thresholds */ /* Rehashing thresholds */
@ -183,6 +181,8 @@ struct UHashtable {
float highWaterRatio; /* 0..1; high water as a fraction of length */ float highWaterRatio; /* 0..1; high water as a fraction of length */
float lowWaterRatio; /* 0..1; low water as a fraction of length */ float lowWaterRatio; /* 0..1; low water as a fraction of length */
int8_t primeIndex; /* Index into our prime table for length.
* length == PRIMES[primeIndex] */
UBool allocated; /* Was this UHashtable allocated? */ UBool allocated; /* Was this UHashtable allocated? */
}; };
typedef struct UHashtable UHashtable; typedef struct UHashtable UHashtable;