[llvm-commits] [llvm] r50210 - /llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp

Nick Lewycky nicholas at mxc.ca
Thu Apr 24 22:27:15 PDT 2008


Gabor Greif wrote:
> Author: ggreif
> Date: Thu Apr 24 04:46:58 2008
> New Revision: 50210
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=50210&view=rev
> Log:
> document the magic numbers
> 
> Modified:
>     llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp
> 
> Modified: llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp?rev=50210&r1=50209&r2=50210&view=diff
> 
> ==============================================================================
> --- llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp (original)
> +++ llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp Thu Apr 24 04:46:58 2008
> @@ -149,6 +149,16 @@
>  void BitcodeReaderValueList::resize(unsigned Desired) {
>    if (Desired > Capacity)
>    {
> +    // Since we expect many values
> +    // to come from the bitcode file
> +    // we better allocate the double
> +    // amount, so that the array size
> +    // grows exponentially at each
> +    // reallocation.  Also, add a small
> +    // amount of 100 extra elements
> +    // each time, to reallocate less
> +    // frequently when the array
> +    // is still small.

Unless you're speaking in verse, please wrap at 80 columns.

>      Capacity = Desired * 2 + 100;
>      Use *New = allocHungoffUses(Capacity);
>      Use *Old = OperandList;
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 




More information about the llvm-commits mailing list