You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ca...@apache.org on 2005/03/11 18:03:37 UTC

cvs commit: xml-xerces/c/src/xercesc/util BaseRefVectorOf.c

cargilld    2005/03/11 09:03:36

  Modified:    c/src/xercesc/util BaseRefVectorOf.c
  Log:
  Patch from David Earlam for XERCESC-1363.  Increase size of BaseRefVectorOf based on size of data not by 32.
  
  Revision  Changes    Path
  1.10      +4 -3      xml-xerces/c/src/xercesc/util/BaseRefVectorOf.c
  
  Index: BaseRefVectorOf.c
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/BaseRefVectorOf.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BaseRefVectorOf.c	7 Jan 2005 15:12:10 -0000	1.9
  +++ BaseRefVectorOf.c	11 Mar 2005 17:03:36 -0000	1.10
  @@ -267,9 +267,10 @@
       if (newMax <= fMaxCount)
           return;
   
  -    // Avoid too many reallocations by providing a little more space
  -    if (newMax < fMaxCount + 32)
  -        newMax = fMaxCount + 32;
  +	// Choose how much bigger based on the current size.
  +	// This will grow half as much again.
  +    if (newMax < fMaxCount + fMaxCount/2)
  +        newMax = fMaxCount + fMaxCount/2;
   
       // Allocate the new array and copy over the existing stuff
       TElem** newList = (TElem**) fMemoryManager->allocate
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org