Bug 1355441 - Reuse StackNode in HTML parser TreeBuilder to avoid malloc. r=hsivonen

This commit is contained in:
William Chen
2017-05-01 17:25:05 -07:00
parent d7a4653ab7
commit b396a8a419
10 changed files with 486 additions and 192 deletions

View File

@@ -220,6 +220,9 @@ nsHtml5StreamParser::nsHtml5StreamParser(nsHtml5TreeOpExecutor* aExecutor,
nsHtml5StreamParser::~nsHtml5StreamParser()
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
// mSpeculations may contain StateSnapshot holding StackNodes that we
// want to free when the tokenizer ends, so clear the speculations first.
mSpeculations.Clear();
mTokenizer->end();
#ifdef DEBUG
{