Make sure linux dedicated servers trim their memory usage on map change (ie: return freed memory pages back to the system).

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6198 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2022-03-01 02:51:46 +00:00
parent a5cb7af5d1
commit d9b4bc1a77

View file

@ -23,6 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef SQL
#include "sv_sql.h"
#endif
#ifdef __GLIBC__
#include <malloc.h> //for malloc_trim
#endif
#ifndef CLIENTONLY
extern int total_loading_size, current_loading_size, loading_stage;
char *T_GetString(int num);
@ -1779,6 +1783,11 @@ MSV_OpenUserDatabase();
#ifdef SAVEDGAMES
sv.autosave_time = sv.time + sv_autosave.value*60;
#endif
#ifdef __GLIBC__
if (isDedicated)
malloc_trim(0);
#endif
}
#endif