diff --git a/icu4c/source/common/cmemory.h b/icu4c/source/common/cmemory.h index 93a2c39f57..1b2b425001 100644 --- a/icu4c/source/common/cmemory.h +++ b/icu4c/source/common/cmemory.h @@ -32,6 +32,10 @@ #include #include "unicode/localpointer.h" +#ifdef __cplusplus +#include "unicode/uobject.h" +#endif + #if U_DEBUG && defined(UPRV_MALLOC_COUNT) #include #endif @@ -701,7 +705,7 @@ inline H *MaybeStackHeaderAndArray::orphanOrClone(int32_t l * It doesn't do anything more than that, and is intentionally kept minimalist. */ template -class MemoryPool { +class MemoryPool : public UMemory { enum { STACK_CAPACITY = 8 }; public: MemoryPool() : count(0), pool() {} diff --git a/icu4c/source/common/uloc_keytype.cpp b/icu4c/source/common/uloc_keytype.cpp index abe83d0a3a..b72aa01d17 100644 --- a/icu4c/source/common/uloc_keytype.cpp +++ b/icu4c/source/common/uloc_keytype.cpp @@ -10,6 +10,7 @@ #include "unicode/utypes.h" #include "unicode/unistr.h" +#include "unicode/uobject.h" #include "charstr.h" #include "cmemory.h" @@ -33,17 +34,17 @@ typedef enum { SPECIALTYPE_RG_KEY_VALUE = 4 } SpecialType; -typedef struct LocExtKeyData { +struct LocExtKeyData : public icu::UMemory { const char* legacyId; const char* bcpId; icu::LocalUHashtablePointer typeMap; uint32_t specialTypes; -} LocExtKeyData; +}; -typedef struct LocExtType { +struct LocExtType : public icu::UMemory { const char* legacyId; const char* bcpId; -} LocExtType; +}; static icu::MemoryPool* gKeyTypeStringPool = NULL; static icu::MemoryPool* gLocExtKeyDataEntries = NULL;