cargilld    2004/01/13 09:12:34

  Modified:    c/src/xercesc/util XMLString.cpp
  Log:
  Undo previous change memory management changes.
  
  Revision  Changes    Path
  1.31      +4 -38     xml-xerces/c/src/xercesc/util/XMLString.cpp
  
  Index: XMLString.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLString.cpp,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- XMLString.cpp     13 Jan 2004 16:34:20 -0000      1.30
  +++ XMLString.cpp     13 Jan 2004 17:12:34 -0000      1.31
  @@ -136,18 +136,8 @@
       //  having to check for overflow in the inner loops, and we have to flip
       //  the resulting XMLString anyway.
       //
  -    char   tmpBuffer[128];
  -    char*  tmpBuf;
  -    char*  bigBuf = 0;
  -    if (maxChars < 128)
  -    {
  -        tmpBuf = tmpBuffer;
  -    }
  -    else
  -    {
  -        bigBuf = (char*) manager->allocate((maxChars+1)* sizeof(char));
  -        tmpBuf = bigBuf;
  -    } 
  +    char   tmpBuf[128];
  +
       //
       //  For each radix, do the optimal thing. For bin and hex, we can special
       //  case them and do shift and mask oriented stuff. For oct and decimal
  @@ -184,16 +174,12 @@
       }
       else
       {
  -        if (bigBuf)
  -            manager->deallocate(bigBuf);
           ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Str_UnknownRadix, manager);
       }
   
       // See if have enough room in the caller's buffer
       if (tmpIndex > maxChars)
       {
  -        if (bigBuf)
  -            manager->deallocate(bigBuf);
           ThrowXMLwithMemMgr(IllegalArgumentException, 
XMLExcepts::Str_TargetBufTooSmall, manager);
       }
   
  @@ -204,8 +190,6 @@
   
       // And cap off the caller's buffer
       toFill[outIndex] = char(0);
  -    if (bigBuf)
  -        manager->deallocate(bigBuf);
   }
   
   void XMLString::binToText(  const   unsigned int    toFormat
  @@ -817,18 +801,7 @@
       //  having to check for overflow in the inner loops, and we have to flip
       //  the resulting sring anyway.
       //
  -    XMLCh   tmpBuffer[128];
  -    XMLCh*  tmpBuf;
  -    XMLCh*  bigBuf = 0;
  -    if (maxChars < 128)
  -    {
  -        tmpBuf = tmpBuffer;
  -    }
  -    else
  -    {
  -        bigBuf = (XMLCh*) manager->allocate((maxChars+1)* sizeof(XMLCh));
  -        tmpBuf = bigBuf;
  -    }
  +    XMLCh   tmpBuf[128];
   
       //
       //  For each radix, do the optimal thing. For bin and hex, we can special
  @@ -866,16 +839,12 @@
       }
        else
       {
  -        if (bigBuf)
  -            manager->deallocate(bigBuf);
           ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Str_UnknownRadix, manager);
       }
   
       // See if have enough room in the caller's buffer
       if (tmpIndex > maxChars)
       {
  -        if (bigBuf)
  -            manager->deallocate(bigBuf);    
           ThrowXMLwithMemMgr(IllegalArgumentException, 
XMLExcepts::Str_TargetBufTooSmall, manager);
       }
   
  @@ -886,9 +855,6 @@
   
       // And cap off the caller's buffer
       toFill[outIndex] = chNull;
  -
  -    if (bigBuf)
  -        manager->deallocate(bigBuf);
   }
   
   void XMLString::binToText(  const   unsigned int    toFormat
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to