summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/wtf/text/AtomicString.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/wtf/text/AtomicString.cpp')
-rw-r--r--JavaScriptCore/wtf/text/AtomicString.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/JavaScriptCore/wtf/text/AtomicString.cpp b/JavaScriptCore/wtf/text/AtomicString.cpp
index 79b9ab5..ab52488 100644
--- a/JavaScriptCore/wtf/text/AtomicString.cpp
+++ b/JavaScriptCore/wtf/text/AtomicString.cpp
@@ -28,8 +28,8 @@
#include "StaticConstructors.h"
#include "StringHash.h"
-#include <wtf/Threading.h>
#include <wtf/HashSet.h>
+#include <wtf/Threading.h>
#include <wtf/WTFThreadData.h>
namespace WebCore {
@@ -55,6 +55,9 @@ public:
private:
static void destroy(AtomicStringTable* table)
{
+ HashSet<StringImpl*>::iterator end = table->m_table.end();
+ for (HashSet<StringImpl*>::iterator iter = table->m_table.begin(); iter != end; ++iter)
+ (*iter)->setIsAtomic(false);
delete table;
}
@@ -92,7 +95,7 @@ struct CStringTranslator {
{
location = StringImpl::create(c).releaseRef();
location->setHash(hash);
- location->setInTable();
+ location->setIsAtomic(true);
}
};
@@ -171,7 +174,7 @@ struct UCharBufferTranslator {
{
location = StringImpl::create(buf.s, buf.length).releaseRef();
location->setHash(hash);
- location->setInTable();
+ location->setIsAtomic(true);
}
};
@@ -197,7 +200,7 @@ struct HashAndCharactersTranslator {
{
location = StringImpl::create(buffer.characters, buffer.length).releaseRef();
location->setHash(hash);
- location->setInTable();
+ location->setIsAtomic(true);
}
};
@@ -254,7 +257,7 @@ PassRefPtr<StringImpl> AtomicString::add(const UChar* s)
PassRefPtr<StringImpl> AtomicString::add(StringImpl* r)
{
- if (!r || r->inTable())
+ if (!r || r->isAtomic())
return r;
if (r->length() == 0)
@@ -262,7 +265,7 @@ PassRefPtr<StringImpl> AtomicString::add(StringImpl* r)
StringImpl* result = *stringTable().add(r).first;
if (result == r)
- r->setInTable();
+ r->setIsAtomic(true);
return result;
}