[webkit-dev] Atomic Strings and static vars
Eric Seidel
macdome at opendarwin.org
Sun Jun 4 09:15:25 PDT 2006
Correct. The AtomicString hash won't be initialized by the time the
constructor is called on a static AtomicString.
Thats why you see AtomicString::init(() and HTMLNames::init(), etc.
See HTMLNames.cpp to see how we get around this (placement new).
-eric
On Jun 4, 2006, at 9:02 AM, Mike Emmel wrote:
> It seems that AtomicStrings can't be used in static variables
>
> #0 WTF::HashTable<WebCore::StringImpl*, WebCore::StringImpl*,
> WTF::IdentityExtractor<WebCore::StringImpl*>,
> WTF::StrHash<WebCore::StringImpl*>,
> WTF::HashTraits<WebCore::StringImpl*>,
> WTF::HashTraits<WebCore::StringImpl*> >::invalidateIterators
> (this=0x0) at HashTable.h:713
> #1 0xb7492432 in WTF::HashSet<WebCore::StringImpl*,
> WTF::StrHash<WebCore::StringImpl*>,
> WTF::HashTraits<WebCore::StringImpl*> >::add<char const*,
> WebCore::CStringTranslator> (this=0x0, value=@0xbf9e41b0) at
> HashTable.h:420
> #2 0xb74905eb in WebCore::AtomicString::add (c=0xb7820af2 "Times
> New Roman")
> at ../../platform/AtomicString.cpp:90
> #3 0xb7762346 in __static_initialization_and_destruction_0 (
> __initialize_p=<value optimized out>, __priority=-65536)
> at AtomicString.h:36
> #4 0xb77efb92 in __do_global_ctors_aux ()
> from ../../WebCore/Projects/gdk/libwebcore-gdk.so
> #5 0xb73cb3bd in _init () from ../../WebCore/Projects/gdk/
> libwebcore-gdk.so
> #6 0xb7fdd194 in _dl_rtld_di_serinfo () from /lib/ld-linux.so.2
> #7 0xb7fdd2be in _dl_rtld_di_serinfo () from /lib/ld-linux.so.2
> #8 0xb7fd27ff in ?? () from /lib/ld-linux.so.2
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at opendarwin.org
> http://www.opendarwin.org/mailman/listinfo/webkit-dev
More information about the webkit-dev
mailing list