diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-08 14:11:13 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-08 14:11:13 +0000 |
commit | 30039e6ec600f1ac2a34e0881f4c0c10ee6f80cd (patch) | |
tree | 081d130207172ab523ea08bb591f0fee9a369f30 /base/build | |
parent | fbcfafe4cd6d4f69ad0e1e3d921fb05bb5fcadfd (diff) | |
download | chromium_src-30039e6ec600f1ac2a34e0881f4c0c10ee6f80cd.zip chromium_src-30039e6ec600f1ac2a34e0881f4c0c10ee6f80cd.tar.gz chromium_src-30039e6ec600f1ac2a34e0881f4c0c10ee6f80cd.tar.bz2 |
Create a LazyInstance abstraction for avoiding static constructors by lazily creating an instance of an object on first access. This is like Singleton, but without the Singleton property of sharing instances. This also preallocates space for the object to avoid the heap to try to help fragmentation and creation performance.
Review URL: http://codereview.chromium.org/1608
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/build')
-rw-r--r-- | base/build/base.vcproj | 8 | ||||
-rw-r--r-- | base/build/base_unittests.vcproj | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/base/build/base.vcproj b/base/build/base.vcproj index 27d7e3c..2dd71a1 100644 --- a/base/build/base.vcproj +++ b/base/build/base.vcproj @@ -370,6 +370,14 @@ > </File> <File + RelativePath="..\lazy_instance.cc" + > + </File> + <File + RelativePath="..\lazy_instance.h" + > + </File> + <File RelativePath="..\linked_ptr.h" > </File> diff --git a/base/build/base_unittests.vcproj b/base/build/base_unittests.vcproj index dbfd6a4..f3993da 100644 --- a/base/build/base_unittests.vcproj +++ b/base/build/base_unittests.vcproj @@ -212,6 +212,10 @@ > </File> <File + RelativePath="..\lazy_instance_unittest.cc" + > + </File> + <File RelativePath="..\linked_ptr_unittest.cc" > </File> |