зеркало из https://github.com/mozilla/pjs.git
Fix so last-ditch GC doesn't collect script filenames (291312, r=shaver, a=me).
This commit is contained in:
Родитель
dc774202e6
Коммит
28b1c8cc4d
|
@ -1680,6 +1680,9 @@ restart:
|
|||
JS_DHashTableEnumerate(rt->gcLocksHash, gc_lock_marker, cx);
|
||||
js_MarkAtomState(&rt->atomState, gcflags, gc_mark_atom_key_thing, cx);
|
||||
js_MarkWatchPoints(rt);
|
||||
if (gcflags & GC_KEEP_ATOMS)
|
||||
js_MarkScriptFilenames(rt);
|
||||
|
||||
iter = NULL;
|
||||
while ((acx = js_ContextIterator(rt, JS_TRUE, &iter)) != NULL) {
|
||||
/*
|
||||
|
|
|
@ -1033,6 +1033,23 @@ js_MarkScriptFilename(const char *filename)
|
|||
sfe->mark = JS_TRUE;
|
||||
}
|
||||
|
||||
JS_STATIC_DLL_CALLBACK(intN)
|
||||
js_script_filename_marker(JSHashEntry *he, intN i, void *arg)
|
||||
{
|
||||
ScriptFilenameEntry *sfe = (ScriptFilenameEntry *) he;
|
||||
|
||||
sfe->mark = JS_TRUE;
|
||||
return HT_ENUMERATE_NEXT;
|
||||
}
|
||||
|
||||
void
|
||||
js_MarkScriptFilenames(JSRuntime *rt)
|
||||
{
|
||||
JS_HashTableEnumerateEntries(rt->scriptFilenameTable,
|
||||
js_script_filename_marker,
|
||||
rt);
|
||||
}
|
||||
|
||||
JS_STATIC_DLL_CALLBACK(intN)
|
||||
js_script_filename_sweeper(JSHashEntry *he, intN i, void *arg)
|
||||
{
|
||||
|
|
|
@ -114,6 +114,9 @@ js_SaveScriptFilename(JSContext *cx, const char *filename);
|
|||
extern void
|
||||
js_MarkScriptFilename(const char *filename);
|
||||
|
||||
extern void
|
||||
js_MarkScriptFilenames(JSRuntime *rt);
|
||||
|
||||
extern void
|
||||
js_SweepScriptFilenames(JSRuntime *rt);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче