Adding better diagnostic message to help in finding and fixing mismatched calls to JS_AddNamedRoot/JS_RemoveRoot. ra=brendan@mozilla.org

This commit is contained in:
jband%netscape.com 2000-08-19 03:25:16 +00:00
Родитель e4a813ca47
Коммит 870adce9bf
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -786,6 +786,13 @@ gc_root_marker(JSHashEntry *he, intN i, void *arg)
break;
}
}
if (!root_points_to_gcArenaPool && he->value) {
fprintf(stderr,
"Error: The address passed to JS_AddNamedRoot currently "
"holds an invalid jsval.\n "
" This is usually caused by a missing call to JS_RemoveRoot.\n "
" Root name is \"%s\".\n", (const char *) he->value);
}
JS_ASSERT(root_points_to_gcArenaPool);
#endif