[openjk] 20/32: MP Server Gamecode: Increase memory pool limit

Simon McVittie smcv at debian.org
Sun Mar 12 18:03:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit 50bde780d55e825e6d7f19478bdaa7373ae118d3
Author: Ensiform <ensiform at gmail.com>
Date:   Sat Mar 11 14:34:28 2017 -0600

    MP Server Gamecode: Increase memory pool limit
    
    Increases memory pool limit to 4 megs from 256k which is used by G_Alloc / G_NewString etc.
---
 codemp/game/g_mem.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/codemp/game/g_mem.c b/codemp/game/g_mem.c
index b047df8..d677b1b 100644
--- a/codemp/game/g_mem.c
+++ b/codemp/game/g_mem.c
@@ -42,7 +42,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
   http://www.altdevblogaday.com/2011/02/12/alternatives-to-malloc-and-new/
 */
 
-#define POOLSIZE	(256 * 1024)
+#define POOLSIZE	(4 * 1024 * 1024) // (256*1024)
 
 static char		memoryPool[POOLSIZE];
 static int		allocPoint;
@@ -76,5 +76,8 @@ void G_InitMemory( void ) {
 }
 
 void Svcmd_GameMem_f( void ) {
-	trap->Print( "Game memory status: %i out of %i bytes allocated\n", allocPoint, POOLSIZE );
+	float f = allocPoint;
+	f /= POOLSIZE;
+	f *= 100;
+	trap->Print("Game Memory Pool is %.1f%% full, %i bytes out of %i used.\n", f, allocPoint, POOLSIZE);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list