[cfe-commits] r129896 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGExprAgg.cpp lib/CodeGen/CGExprConstant.cpp lib/Sema/SemaInit.cpp lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriterStmt.cpp test/Index/initializer-memory.cpp

Argyrios Kyrtzidis kyrtzidis at apple.com
Thu Apr 21 13:12:33 PDT 2011


On Apr 21, 2011, at 10:27 AM, Johannes Schaub (litb) wrote:

> Argyrios Kyrtzidis wrote:
> 
>> Author: akirtzidis
>> Date: Wed Apr 20 19:27:41 2011
>> New Revision: 129896
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=129896&view=rev
>> Log:
>> For
>> 
>> double data[20000000] = {0};
>> 
>> we would blow out the memory by creating 20M Exprs to fill out the
>> initializer.
>> 
> 
> Does this fix designated initializer blowup too?
> 
>    double data[20000000] = { [19999999] = 1 };

After r129933, for this case, we will only create 20M pointers and not create the Exprs to fill them out, so from 460MB it will go down to 152MB.

Personally, I don't care enough for this case to further complicate the code. Anyone else wanting to do something better is more than welcome!

> 
> Thanks.
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list