]> granicus.if.org Git - icu/commitdiff
ICU-20202 MemoryPool and uloc_key_type structs inherit from UMemory. Fixes dependenci...
authorAndy Heninger <andy.heninger@gmail.com>
Fri, 2 Nov 2018 21:54:45 +0000 (14:54 -0700)
committerAndy Heninger <andy.heninger@gmail.com>
Fri, 2 Nov 2018 22:38:31 +0000 (15:38 -0700)
icu4c/source/common/cmemory.h
icu4c/source/common/uloc_keytype.cpp

index 93a2c39f572dfd77e2bdd5ee1e16c1d79c663f37..1b2b4250016d76ee2f3303bce940e20539a8123f 100644 (file)
 #include <string.h>
 #include "unicode/localpointer.h"
 
+#ifdef __cplusplus
+#include "unicode/uobject.h"
+#endif
+
 #if U_DEBUG && defined(UPRV_MALLOC_COUNT)
 #include <stdio.h>
 #endif
@@ -701,7 +705,7 @@ inline H *MaybeStackHeaderAndArray<H, T, stackCapacity>::orphanOrClone(int32_t l
  * It doesn't do anything more than that, and is intentionally kept minimalist.
  */
 template<typename T>
-class MemoryPool {
+class MemoryPool : public UMemory {
     enum { STACK_CAPACITY = 8 };
 public:
     MemoryPool() : count(0), pool() {}
index abe83d0a3aa5a7e68a5a306bdd3d50daa25db6df..b72aa01d17fefc10ef7ae6e7a0b4bd2c31cd13ce 100644 (file)
@@ -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<icu::CharString>* gKeyTypeStringPool = NULL;
 static icu::MemoryPool<LocExtKeyData>* gLocExtKeyDataEntries = NULL;