Skip to content

Commit

Permalink
Remove unnecessary garbage collection on SquirrelVM saverestore
Browse files Browse the repository at this point in the history
  • Loading branch information
samisalreadytaken committed Jun 29, 2024
1 parent 26346ba commit 871058a
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions sp/src/vscript/vscript_squirrel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4503,29 +4503,14 @@ void SquirrelVM::WriteState( CUtlBuffer* pBuffer )
// If the main VM can be suspended, WriteVM/ReadVM would need to include the code inside OT_THREAD r/w
Assert( !vm_->ci );

if ( int c = sq_collectgarbage( vm_ ) > 0 )
{
Warning( "SquirrelVM::WriteVM: %d garbage refs\n", c );
}

WriteStateMap writeState;
WriteVM( vm_, pBuffer, writeState );
}

void SquirrelVM::ReadState( CUtlBuffer* pBuffer )
{
if ( int c = sq_collectgarbage( vm_ ) > 0 )
{
Warning( "SquirrelVM::ReadVM: %d garbage refs (pre-read)\n", c );
}

ReadStateMap readState;
ReadVM( vm_, pBuffer, readState );

if ( int c = sq_collectgarbage( vm_ ) > 0 )
{
Warning( "SquirrelVM::ReadVM: %d garbage refs\n", c );
}
}

void SquirrelVM::RemoveOrphanInstances()
Expand Down

0 comments on commit 871058a

Please sign in to comment.