Skip to content
Commit 7310ea61 authored by Milian Wolff's avatar Milian Wolff
Browse files

Use union in PrimaryExpressionAST to reduce memory footprint.

On 64Bit machines, we had sizeof(PrimaryExpressionAST) == 64.
By using a union and enum this can be decreased to 40.

This can result in dramatically less memory consumption, esp. for
large qrc files e.g. In the case of the file attached to bug 291248
the memory consumption dropped by 200MB.

While the code handling is now a bit changed, I still think this
change is worth it. While at it, I've also refactored
ExpressionVisitor::visitPrimaryExpression. This gives us cleaner code
and should also be faster since we can use the token type instead of
doing string comparisons to find numbers.

CCBUG: 291248
parent 1cf0cce4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment