#include "mutex.h"
#include "uassert.h"
#include "ucln_cmn.h"
-#include <stdio.h>
static icu::UnifiedCache *gCache = NULL;
static icu::SharedObject *gNoValue = NULL;
umtx_condBroadcast(&gInProgressValueAddedCond);
}
+#ifdef UNIFIED_CACHE_DEBUG
+#include <stdio.h>
+
void UnifiedCache::dump() {
UErrorCode status = U_ZERO_ERROR;
const UnifiedCache *cache = getInstance(status);
}
fprintf(stderr, "Unified Cache: %d out of a total of %d still have hard references\n", cnt, uhash_count(fHashtable));
}
+#endif
UnifiedCache::~UnifiedCache() {
// Try our best to clean up first.
}
}
+#ifdef UNIFIED_CACHE_DEBUG
/**
* Dumps the contents of this cache to standard error. Used for testing of
* cache only.
*/
void dumpContents() const;
+#endif
/**
* Convenience method to get a value of type T from cache for a
cache->get(LocaleCacheKey<T>(loc), ptr, status);
}
+#ifdef UNIFIED_CACHE_DEBUG
/**
* Dumps the cache contents to stderr. For testing only.
*/
static void dump();
+#endif
/**
* Returns the number of keys in this cache. For testing only.
const CacheKeyBase &key,
const SharedObject *&value,
UErrorCode &status) const;
+#ifdef UNIFIED_CACHE_DEBUG
void _dumpContents() const;
+#endif
static void _put(
const UHashElement *element,
const SharedObject *value,