X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..b25be06635768807f8f693286fa73bb2297bb06c:/icuSources/common/uhash.h diff --git a/icuSources/common/uhash.h b/icuSources/common/uhash.h index b5f3a67d..c1c50ed4 100644 --- a/icuSources/common/uhash.h +++ b/icuSources/common/uhash.h @@ -1,6 +1,6 @@ /* ****************************************************************************** -* Copyright (C) 1997-2006, International Business Machines +* Copyright (C) 1997-2010, International Business Machines * Corporation and others. All Rights Reserved. ****************************************************************************** * Date Name Description @@ -130,6 +130,7 @@ typedef UBool U_CALLCONV UValueComparator(const UHashTok val1, * uhash_close, or uhash_put to delete * an existing key or value. * @param obj A key or value stored in a hashtable + * @see uhash_deleteUObject */ typedef void U_CALLCONV UObjectDeleter(void* obj); @@ -173,8 +174,6 @@ struct UHashtable { * never let count == length (see code). */ int32_t length; /* The physical size of the arrays hashes, keys * and values. Must be prime. */ - int32_t primeIndex; /* Index into our prime table for length. - * length == PRIMES[primeIndex] */ /* Rehashing thresholds */ @@ -183,6 +182,8 @@ struct UHashtable { float highWaterRatio; /* 0..1; high 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? */ }; typedef struct UHashtable UHashtable; @@ -246,7 +247,7 @@ uhash_init(UHashtable *hash, /** * Close a UHashtable, releasing the memory used. - * @param hash The UHashtable to close. + * @param hash The UHashtable to close. If hash is NULL no operation is performed. */ U_CAPI void U_EXPORT2 uhash_close(UHashtable *hash); @@ -702,11 +703,11 @@ U_CAPI void U_EXPORT2 uhash_deleteHashtable(void *obj); /** - * Deleter for UVector objects. + * Deleter for UObject instances. * @param obj The object to be deleted */ U_CAPI void U_EXPORT2 -uhash_deleteUVector(void *obj); +uhash_deleteUObject(void *obj); /** * Deleter for any key or value allocated using uprv_malloc. Calls