Changeset 59171 in webkit for trunk/JavaScriptCore/wtf/text/AtomicString.cpp
- Timestamp:
- May 11, 2010, 1:52:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/text/AtomicString.cpp
r58851 r59171 21 21 #include "config.h" 22 22 23 #ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC24 #define ATOMICSTRING_HIDE_GLOBALS 125 #endif26 27 23 #include "AtomicString.h" 28 24 29 #include "StaticConstructors.h"30 25 #include "StringHash.h" 31 26 #include <wtf/HashSet.h> … … 300 295 } 301 296 302 JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, nullAtom) 303 JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, emptyAtom, "") 304 JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, textAtom, "#text") 305 JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, commentAtom, "#comment") 306 JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, starAtom, "*") 307 JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlAtom, "xml") 308 JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlnsAtom, "xmlns") 309 310 void AtomicString::init() 311 { 312 static bool initialized; 313 if (!initialized) { 314 // Initialization is not thread safe, so this function must be called from the main thread first. 315 ASSERT(isMainThread()); 316 317 // Use placement new to initialize the globals. 318 new ((void*)&nullAtom) AtomicString; 319 new ((void*)&emptyAtom) AtomicString(""); 320 new ((void*)&textAtom) AtomicString("#text"); 321 new ((void*)&commentAtom) AtomicString("#comment"); 322 new ((void*)&starAtom) AtomicString("*"); 323 new ((void*)&xmlAtom) AtomicString("xml"); 324 new ((void*)&xmlnsAtom) AtomicString("xmlns"); 325 326 initialized = true; 327 } 328 } 329 330 } 297 }
Note:
See TracChangeset
for help on using the changeset viewer.