Backed out changeset cf239b55242a, possible memory leak. r=graphserver

This commit is contained in:
Jeff Walden
2012-09-17 15:06:16 -07:00
parent 3f6a67b168
commit 49193a2912
4 changed files with 16 additions and 25 deletions

View File

@@ -159,16 +159,16 @@ js::InitCommonNames(JSContext *cx)
#undef COMMON_NAME_INFO
};
FixedHeapPtr<PropertyName> *names = &cx->runtime->firstCachedName;
PropertyName **names = &cx->runtime->firstCachedName;
for (size_t i = 0; i < ArrayLength(cachedNames); i++, names++) {
JSAtom *atom = Atomize(cx, cachedNames[i].str, cachedNames[i].length, InternAtom);
if (!atom)
return false;
names->init(atom->asPropertyName());
*names = atom->asPropertyName();
}
JS_ASSERT(uintptr_t(names) == uintptr_t(&cx->runtime->atomState + 1));
cx->runtime->emptyString = cx->names().empty;
cx->runtime->emptyString = cx->runtime->atomState.emptyAtom;
return true;
}