Add WTF::NeverDestroyed and start using it in WTF
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 16:56:14 +0000 (16:56 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 16:56:14 +0000 (16:56 +0000)
commit80edb8f0beea33d8de79606295528893096ed0f5
tree7bbf40149129808be82cc38d30703a2a587a7907
parent1e97a59124049aafa3976d0a29c4bd5bb5dc85eb
Add WTF::NeverDestroyed and start using it in WTF
https://bugs.webkit.org/show_bug.cgi?id=116472

Reviewed by Benjamin Poulain.

NeverDestroyed is a class template that can be used for singletons and other objects that we never
want to destroy. It's intended as a replacement for WTF_STATIC_LOCAL with the advantage that it doesn't
fragment the heap.

* GNUmakefile.list.am:
* WTF.vcproj/WTF.vcproj:
* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
Add NeverDestroyed.h

* wtf/Compiler.h:
Add a helper macro, WTF_DELETED_FUNCTION.

* wtf/CryptographicallyRandomNumber.cpp:
Use NeverDestroyed.

* wtf/NeverDestroyed.h: Added.

* wtf/Noncopyable.h:
Use WTF_DELETED_FUNCTION.

* wtf/text/WTFString.cpp:
(WTF::emptyString):
Use

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/WTF.vcproj/WTF.vcproj
Source/WTF/WTF.vcxproj/WTF.vcxproj
Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/Compiler.h
Source/WTF/wtf/CryptographicallyRandomNumber.cpp
Source/WTF/wtf/NeverDestroyed.h [new file with mode: 0644]
Source/WTF/wtf/Noncopyable.h
Source/WTF/wtf/text/WTFString.cpp