Tweaks to the savestate system that fix some heavy file fragmentation on NTFS in windows (of course :p ), but are also a small speedup.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2795 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2010-03-30 18:32:05 +00:00
parent 74087b86b0
commit f2c11e23ad
1 changed files with 5 additions and 2 deletions

View File

@ -213,7 +213,10 @@ protected:
static const int BlockSize = 0x20000; static const int BlockSize = 0x20000;
int curidx = 0; int curidx = 0;
gzsetparams(m_gzfp, Z_BEST_SPEED, Z_FILTERED); // Best speed at good compression
gzbuffer(m_gzfp, 0x100000); // 1mb buffer size for less file fragments
gzwrite(m_gzfp, SavestateIdentString, sizeof( SavestateIdentString )); gzwrite(m_gzfp, SavestateIdentString, sizeof( SavestateIdentString ));
gzwrite(m_gzfp, &g_SaveVersion, sizeof( g_SaveVersion )); gzwrite(m_gzfp, &g_SaveVersion, sizeof( g_SaveVersion ));
@ -323,7 +326,7 @@ protected:
static const int BlockSize = 0x100000; static const int BlockSize = 0x100000;
state_buffer.MakeRoomFor( 0x800000 ); // start with an 8 meg buffer to avoid frequent reallocation. state_buffer.MakeRoomFor( 0x800000 ); // start with an 8 meg buffer to avoid frequent reallocation.
gzbuffer(m_gzfp, 0x100000); // 1mb buffer for zlib internal operations
int curidx = 0; int curidx = 0;
do do
{ {