From 67e7cde5c5e59a8f1de7ee28276b8193ecb2bc7f Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 20 Mar 2013 17:47:16 +0000 Subject: revert 8265-8264 (broke build) git-svn-id: http://skia.googlecode.com/svn/trunk@8268 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkTLazy.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'include/core') diff --git a/include/core/SkTLazy.h b/include/core/SkTLazy.h index 1934b5dff9..b9052f0d99 100644 --- a/include/core/SkTLazy.h +++ b/include/core/SkTLazy.h @@ -14,9 +14,6 @@ #include "SkTypes.h" #include -template class SkTLazy; -template void* operator new(size_t, SkTLazy* lazy); - /** * Efficient way to defer allocating/initializing a class until it is needed * (if ever). @@ -47,7 +44,7 @@ public: /** * Return a pointer to a default-initialized instance of the class. If a - * previous instance had been initialized (either from init() or set()) it + * previous instance had been initialzied (either from init() or set()) it * will first be destroyed, so that a freshly initialized instance is * always returned. */ @@ -87,27 +84,10 @@ public: T* get() const { SkASSERT(this->isValid()); return fPtr; } private: - friend void* operator new(size_t, SkTLazy* lazy); - T* fPtr; // NULL or fStorage char fStorage[sizeof(T)]; }; -// Use the below macro (SkNEW_IN_TLAZY) rather than calling this directly -template void* operator new(size_t, SkTLazy* lazy) { - SkASSERT(!lazy->isValid()); - lazy->fPtr = reinterpret_cast(lazy->fStorage); - return lazy->fPtr; -} - -// Skia doesn't use C++ exceptions but it may be compiled with them enabled. Having an op delete -// to match the op new silences warnings about missing op delete when a constructor throws an -// exception. -template void operator delete(void*, SkTLazy) { SK_CRASH(); } - -// Use this to construct a T inside an SkTLazy using a non-default constructor. -#define SkNEW_IN_TLAZY(tlazy_ptr, type_name, args) (new (tlazy_ptr) type_name args) - /** * A helper built on top of SkTLazy to do copy-on-first-write. The object is initialized * with a const pointer but provides a non-const pointer accessor. The first time the -- cgit v1.2.3