[Kst] branches/work/kst/portto4/kst/src/datasources/ascii

Peter Kümmel syntheticpp at gmx.net
Wed Oct 17 19:53:02 UTC 2012


SVN commit 1321062 by kuemmel:

memory is now allocated while reading

with this resize memory usage doubles

 M  +3 -8      asciifilebuffer.cpp  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciifilebuffer.cpp #1321061:1321062
@@ -145,15 +145,10 @@
   if (bytesToRead == windowSize)
   {
     for (int i = 0; i < chunks.size(); i++) {
-      AsciiFileData& chunk = chunks[i];
-      if (!chunk.resize(chunk.bytesRead())) {
-        Kst::Debug::self()->log(QString("AsciiFileBuffer: not enough memory available to read whole file"));
-        return;
+      chunks[i].setFile(_file);
+      chunks[i].setReread(reread);
+      _bytesRead += chunks[i].bytesRead();
       }
-      chunk.setFile(_file);
-      chunk.setReread(reread);
-      _bytesRead += chunk.bytesRead();
-    }
     _fileData.push_back(chunks);
   }
   else


More information about the Kst mailing list