LibWeb: Throw out decoded UTF-32 data in HTMLTokenizer after parser runs

This ends up saving quite a bit of memory on many pages, since UTF-32
uses 4 bytes per code points.

As an example, it reduces the footprint on https://gymgrossisten.com/
by 2 MiB.
This commit is contained in:
Andreas Kling 2025-10-23 21:45:00 +02:00 committed by Andreas Kling
parent b10f2993b3
commit 3593c3b687
Notes: github-actions[bot] 2025-10-24 06:54:24 +00:00
3 changed files with 18 additions and 0 deletions

View file

@ -145,6 +145,8 @@ public:
// This permanently cuts off the tokenizer input stream.
void abort() { m_aborted = true; }
void parser_did_run(Badge<HTMLParser>);
private:
void skip(size_t count);
Optional<u32> next_code_point(StopAtInsertionPoint);