Summary: | Use less memory when compiling content extensions | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||||||
Component: | WebCore Misc. | Assignee: | Alex Christensen <achristensen> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | benjamin | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Alex Christensen
2015-04-16 17:38:35 PDT
Created attachment 250983 [details]
Patch
Comment on attachment 250983 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250983&action=review Simon would like more info in the changelog. I don't like the "// Free memory.", they are not adding any information. > Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:165 > + parsedRuleList = Vector<ContentExtensionRule>(); // Free memory. > + actionLocations = Vector<unsigned>(); // Free memory. Vector has clear(). A single comment on top of the two lines would be better. > Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:179 > Vector<NFA> nfas = combinedURLFilters.createNFAs(); > if (!nfas.size() && universalActionLocations.size()) > nfas.append(NFA()); > + combinedURLFilters.clear(); // Free memory. I am unconvinced this is the right balance. We should look into generating the NFAs one by one out of the combinedURLFilters, generate its DFA, clear the NFA, generate the bytecode, clear the DFA. > Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:240 > + nfas = Vector<NFA>(); // Free memory. nfas.clear()? Created attachment 250984 [details]
Patch
Created attachment 250986 [details]
Patch
|