Commit 30fe43f6 authored by William M. Brack's avatar William M. Brack

put in patch for Windows buffer re-allocation submitted by Steve Hay (bug

* tree.c: put in patch for Windows buffer re-allocation
  submitted by Steve Hay (bug 146697)
parent b85c9205
Mon Jul 26 11:03:18 PDT 2004 William Brack <wbrack@mmm.com.hk>
* tree.c: put in patch for Windows buffer re-allocation
submitted by Steve Hay (bug 146697)
Sun Jul 25 17:18:39 PDT 2004 William Brack <wbrack@mmm.com.hk>
* xinclude.c: added some code to check, when an include is
......
......@@ -6607,7 +6607,18 @@ xmlBufferGrow(xmlBufferPtr buf, unsigned int len) {
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
if (len + buf->use < buf->size) return(0);
/*
* Windows has a BIG problem on realloc timing, so we try to double
* the buffer size (if that's enough) (bug 146697)
*/
#ifdef WIN32
if (buf->size > len)
size = buf->size * 2;
else
size = buf->use + len + 100;
#else
size = buf->use + len + 100;
#endif
newbuf = (xmlChar *) xmlRealloc(buf->content, size);
if (newbuf == NULL) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment