Changeset 59172 in webkit for trunk/JavaScriptCore/wtf/text/AtomicString.cpp
- Timestamp:
- May 11, 2010, 2:35:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/text/AtomicString.cpp
r59171 r59172 21 21 #include "config.h" 22 22 23 #ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC 24 #define ATOMICSTRING_HIDE_GLOBALS 1 25 #endif 26 23 27 #include "AtomicString.h" 24 28 29 #include "StaticConstructors.h" 25 30 #include "StringHash.h" 26 31 #include <wtf/HashSet.h> … … 295 300 } 296 301 297 } 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 }
Note:
See TracChangeset
for help on using the changeset viewer.