diff --git a/icu4c/source/common/uhash.h b/icu4c/source/common/uhash.h index ac634e8a42c..3113508d26f 100644 --- a/icu4c/source/common/uhash.h +++ b/icu4c/source/common/uhash.h @@ -502,6 +502,18 @@ uhash_compareLong(const UHashKey key1, const UHashKey key2); * Other Support Functions ********************************************************************/ +/** + * Deleter for Hashtable objects. + */ +U_CAPI void +uhash_deleteHashtable(void *obj); + +/** + * Deleter for UVector objects. + */ +U_CAPI void +uhash_deleteUVector(void *obj); + /** * Deleter for any key or value allocated using uprv_malloc. Calls * uprv_free. diff --git a/icu4c/source/common/uhash_us.cpp b/icu4c/source/common/uhash_us.cpp index 033247d0253..a086a33415c 100644 --- a/icu4c/source/common/uhash_us.cpp +++ b/icu4c/source/common/uhash_us.cpp @@ -11,6 +11,8 @@ */ #include "uhash.h" +#include "hash.h" +#include "uvector.h" #include "unicode/unistr.h" /******************************************************************** @@ -65,3 +67,21 @@ uhash_compareCaselessUnicodeString(const UHashKey key1, const UHashKey key2) { } return str1->caseCompare(*str2, U_FOLD_CASE_DEFAULT) == 0; } + +/** + * Deleter for Hashtable objects. + */ +U_CAPI void +uhash_deleteHashtable(void *obj) { + delete (Hashtable*) obj; +} + +/** + * Deleter for UVector objects. + */ +U_CAPI void +uhash_deleteUVector(void *obj) { + delete (UVector*) obj; +} + +//eof