[llvm-commits] [llvm] r50210 - /llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp
Gabor Greif
ggreif at gmail.com
Thu Apr 24 02:47:00 PDT 2008
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.
Capacity = Desired * 2 + 100;
Use *New = allocHungoffUses(Capacity);
Use *Old = OperandList;
More information about the llvm-commits
mailing list