Index: src/lazy/SkDiscardableMemoryPool.cpp |
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp |
index 2be4c755f1e0c3196fbc13a439333c7cdeadd55f..d6753def9d2263e84bc8d156c0e317616b5d4025 100644 |
--- a/src/lazy/SkDiscardableMemoryPool.cpp |
+++ b/src/lazy/SkDiscardableMemoryPool.cpp |
@@ -9,7 +9,7 @@ |
#include "SkDiscardableMemoryPool.h" |
#include "SkImageGenerator.h" |
#include "SkMutex.h" |
-#include "SkOncePtr.h" |
+#include "SkOnce.h" |
#include "SkTInternalLList.h" |
// Note: |
@@ -245,11 +245,13 @@ |
} |
SK_DECLARE_STATIC_MUTEX(gMutex); |
-SK_DECLARE_STATIC_ONCE_PTR(SkDiscardableMemoryPool, global); |
SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() { |
- return global.get([] { |
- return SkDiscardableMemoryPool::Create(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE, |
- &gMutex); |
+ static SkOnce once; |
+ static SkDiscardableMemoryPool* global; |
+ once([]{ |
+ global = SkDiscardableMemoryPool::Create(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE, |
+ &gMutex); |
}); |
-} |
+ return global; |
+} |