You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2014/06/24 11:48:21 UTC

svn commit: r1605044 - /openoffice/trunk/main/l10ntools/source/export2.cxx

Author: hdu
Date: Tue Jun 24 09:48:21 2014
New Revision: 1605044

URL: http://svn.apache.org/r1605044
Log:
#i125143# reduce helpex stack usage to prevent intermittent failures

moving the 1MB copy buffer from the stack to the heap solves the problem
that was first observed on the Windows buildbot.

Modified:
    openoffice/trunk/main/l10ntools/source/export2.cxx

Modified: openoffice/trunk/main/l10ntools/source/export2.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/l10ntools/source/export2.cxx?rev=1605044&r1=1605043&r2=1605044&view=diff
==============================================================================
--- openoffice/trunk/main/l10ntools/source/export2.cxx (original)
+++ openoffice/trunk/main/l10ntools/source/export2.cxx Tue Jun 24 09:48:21 2014
@@ -36,6 +36,7 @@
 #include <tools/urlobj.hxx>
 #include <time.h>
 #include <stdlib.h>
+#include <boost/shared_ptr.hpp>
 
 using namespace std;
 //
@@ -339,9 +340,6 @@ void Export::RemoveUTF8ByteOrderMarkerFr
 bool Export::CopyFile( const ByteString& source , const ByteString& dest )
 {
 //    cout << "CopyFile( " << source.GetBuffer() << " , " << dest.GetBuffer() << " )\n";
-    static const int BUFFERSIZE = 0x100000;
-    char buf[ BUFFERSIZE ];
-
     FILE* IN_FILE = fopen( source.GetBuffer() , "r" );
     if( IN_FILE == NULL )
     {
@@ -357,6 +355,10 @@ bool Export::CopyFile( const ByteString&
         return false;
     }
 
+    static const int BUFFERSIZE = 0x100000;
+    boost::shared_ptr<char> aScopedBuffer( new char[BUFFERSIZE] );
+    char* buf = aScopedBuffer.get();
+
     bool bOk = true;
     while( bOk )
     {