summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-03 11:40:16 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:13 +0000
commitcd01b7da984dbc08cafb110ab33f432c6fe963f5 (patch)
tree7bcd7c3223e34ee789574ee02b8faee8b6668463 /src
parentdc7aab757ad488f4b960e7de8750022a990a8af5 (diff)
* Consolidate memory allocation into bg_alloc.c
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_local.h8
-rw-r--r--src/cgame/cg_main.c2
-rw-r--r--src/cgame/cg_mem.c202
-rw-r--r--src/game/bg_alloc.c (renamed from src/game/g_mem.c)104
-rw-r--r--src/game/bg_public.h5
-rw-r--r--src/game/g_admin.c34
-rw-r--r--src/game/g_buildable.c2
-rw-r--r--src/game/g_local.h10
-rw-r--r--src/game/g_main.c4
-rw-r--r--src/game/g_spawn.c2
-rw-r--r--src/game/g_svcmds.c6
11 files changed, 72 insertions, 307 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 71804880..4f51f934 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1794,14 +1794,6 @@ void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops );
void CG_CheckChangedPredictableEvents( playerState_t *ps );
//
-// cg_mem.c
-//
-void CG_InitMemory( void );
-void *CG_Alloc( int size );
-void CG_Free( void *ptr );
-void CG_DefragmentMemory( void );
-
-//
// cg_attachment.c
//
qboolean CG_AttachmentPoint( attachment_t *a, vec3_t v );
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index a60fe0b4..0ac7896c 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -1797,7 +1797,7 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum )
BG_InitAllowedGameElements( );
// Dynamic memory
- CG_InitMemory( );
+ BG_InitMemory( );
CG_RegisterCvars( );
diff --git a/src/cgame/cg_mem.c b/src/cgame/cg_mem.c
deleted file mode 100644
index 6cf5ddd8..00000000
--- a/src/cgame/cg_mem.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
-===========================================================================
-Copyright (C) 1999-2005 Id Software, Inc.
-Copyright (C) 2000-2006 Tim Angus
-
-This file is part of Tremulous.
-
-Tremulous is free software; you can redistribute it
-and/or modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of the License,
-or (at your option) any later version.
-
-Tremulous is distributed in the hope that it will be
-useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Tremulous; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-===========================================================================
-*/
-
-#include "cg_local.h"
-
-#define POOLSIZE (256 * 1024)
-#define FREEMEMCOOKIE ((int)0xDEADBE3F) // Any unlikely to be used value
-#define ROUNDBITS 31 // Round to 32 bytes
-
-struct freememnode
-{
- // Size of ROUNDBITS
- int cookie, size; // Size includes node (obviously)
- struct freememnode *prev, *next;
-};
-
-static char memoryPool[ POOLSIZE ];
-static struct freememnode *freehead;
-static int freemem;
-
-void *CG_Alloc( int size )
-{
- // Find a free block and allocate.
- // Does two passes, attempts to fill same-sized free slot first.
-
- struct freememnode *fmn, *prev, *next, *smallest;
- int allocsize, smallestsize;
- char *endptr;
- int *ptr;
-
- allocsize = ( size + sizeof(int) + ROUNDBITS ) & ~ROUNDBITS; // Round to 32-byte boundary
- ptr = NULL;
-
- smallest = NULL;
- smallestsize = POOLSIZE + 1; // Guaranteed not to miss any slots :)
- for( fmn = freehead; fmn; fmn = fmn->next )
- {
- if( fmn->cookie != FREEMEMCOOKIE )
- CG_Error( "CG_Alloc: Memory corruption detected!\n" );
-
- if( fmn->size >= allocsize )
- {
- // We've got a block
- if( fmn->size == allocsize )
- {
- // Same size, just remove
-
- prev = fmn->prev;
- next = fmn->next;
- if( prev )
- prev->next = next; // Point previous node to next
- if( next )
- next->prev = prev; // Point next node to previous
- if( fmn == freehead )
- freehead = next; // Set head pointer to next
- ptr = (int *) fmn;
- break; // Stop the loop, this is fine
- }
- else
- {
- // Keep track of the smallest free slot
- if( fmn->size < smallestsize )
- {
- smallest = fmn;
- smallestsize = fmn->size;
- }
- }
- }
- }
-
- if( !ptr && smallest )
- {
- // We found a slot big enough
- smallest->size -= allocsize;
- endptr = (char *) smallest + smallest->size;
- ptr = (int *) endptr;
- }
-
- if( ptr )
- {
- freemem -= allocsize;
- if( cg_debugAlloc.integer )
- CG_Printf( "CG_Alloc of %i bytes (%i left)\n", allocsize, freemem );
- memset( ptr, 0, allocsize );
- *ptr++ = allocsize; // Store a copy of size for deallocation
- return( (void *) ptr );
- }
-
- CG_Error( "CG_Alloc: failed on allocation of %i bytes\n", size );
- return( NULL );
-}
-
-void CG_Free( void *ptr )
-{
- // Release allocated memory, add it to the free list.
-
- struct freememnode *fmn;
- char *freeend;
- int *freeptr;
-
- freeptr = ptr;
- freeptr--;
-
- freemem += *freeptr;
- if( cg_debugAlloc.integer )
- CG_Printf( "CG_Free of %i bytes (%i left)\n", *freeptr, freemem );
-
- for( fmn = freehead; fmn; fmn = fmn->next )
- {
- freeend = ((char *) fmn) + fmn->size;
- if( freeend == (char *) freeptr )
- {
- // Released block can be merged to an existing node
-
- fmn->size += *freeptr; // Add size of node.
- return;
- }
- }
- // No merging, add to head of list
-
- fmn = (struct freememnode *) freeptr;
- fmn->size = *freeptr; // Set this first to avoid corrupting *freeptr
- fmn->cookie = FREEMEMCOOKIE;
- fmn->prev = NULL;
- fmn->next = freehead;
- freehead->prev = fmn;
- freehead = fmn;
-}
-
-void CG_InitMemory( void )
-{
- // Set up the initial node
-
- freehead = (struct freememnode *) memoryPool;
- freehead->cookie = FREEMEMCOOKIE;
- freehead->size = POOLSIZE;
- freehead->next = NULL;
- freehead->prev = NULL;
- freemem = sizeof(memoryPool);
-}
-
-void CG_DefragmentMemory( void )
-{
- // If there's a frenzy of deallocation and we want to
- // allocate something big, this is useful. Otherwise...
- // not much use.
-
- struct freememnode *startfmn, *endfmn, *fmn;
-
- for( startfmn = freehead; startfmn; )
- {
- endfmn = (struct freememnode *)(((char *) startfmn) + startfmn->size);
- for( fmn = freehead; fmn; )
- {
- if( fmn->cookie != FREEMEMCOOKIE )
- CG_Error( "CG_DefragmentMemory: Memory corruption detected!\n" );
-
- if( fmn == endfmn )
- {
- // We can add fmn onto startfmn.
-
- if( fmn->prev )
- fmn->prev->next = fmn->next;
- if( fmn->next )
- {
- if( !(fmn->next->prev = fmn->prev) )
- freehead = fmn->next; // We're removing the head node
- }
- startfmn->size += fmn->size;
- memset( fmn, 0, sizeof(struct freememnode) ); // A redundant call, really.
-
- startfmn = freehead;
- endfmn = fmn = NULL; // Break out of current loop
- }
- else
- fmn = fmn->next;
- }
-
- if( endfmn )
- startfmn = startfmn->next; // endfmn acts as a 'restart' flag here
- }
-}
diff --git a/src/game/g_mem.c b/src/game/bg_alloc.c
index 69351940..080bf83a 100644
--- a/src/game/g_mem.c
+++ b/src/game/bg_alloc.c
@@ -21,29 +21,35 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#include "g_local.h"
+#include "../qcommon/q_shared.h"
+#include "bg_public.h"
+
+#ifdef GAME
+# define POOLSIZE ( 1024 * 1024 )
+#else
+# define POOLSIZE ( 256 * 1024 )
+#endif
-#define POOLSIZE ( 1024 * 1024 )
#define FREEMEMCOOKIE ((int)0xDEADBE3F) // Any unlikely to be used value
#define ROUNDBITS 31 // Round to 32 bytes
-struct freememnode
+typedef struct freeMemNode_s
{
// Size of ROUNDBITS
int cookie, size; // Size includes node (obviously)
- struct freememnode *prev, *next;
-};
+ struct freeMemNode_s *prev, *next;
+} freeMemNode_t;
-static char memoryPool[POOLSIZE];
-static struct freememnode *freehead;
-static int freemem;
+static char memoryPool[POOLSIZE];
+static freeMemNode_t *freeHead;
+static int freeMem;
-void *G_Alloc( int size )
+void *BG_Alloc( int size )
{
// Find a free block and allocate.
// Does two passes, attempts to fill same-sized free slot first.
- struct freememnode *fmn, *prev, *next, *smallest;
+ freeMemNode_t *fmn, *prev, *next, *smallest;
int allocsize, smallestsize;
char *endptr;
int *ptr;
@@ -53,10 +59,10 @@ void *G_Alloc( int size )
smallest = NULL;
smallestsize = POOLSIZE + 1; // Guaranteed not to miss any slots :)
- for( fmn = freehead; fmn; fmn = fmn->next )
+ for( fmn = freeHead; fmn; fmn = fmn->next )
{
if( fmn->cookie != FREEMEMCOOKIE )
- G_Error( "G_Alloc: Memory corruption detected!\n" );
+ Com_Error( ERR_DROP, "BG_Alloc: Memory corruption detected!\n" );
if( fmn->size >= allocsize )
{
@@ -71,8 +77,8 @@ void *G_Alloc( int size )
prev->next = next; // Point previous node to next
if( next )
next->prev = prev; // Point next node to previous
- if( fmn == freehead )
- freehead = next; // Set head pointer to next
+ if( fmn == freeHead )
+ freeHead = next; // Set head pointer to next
ptr = (int *) fmn;
break; // Stop the loop, this is fine
}
@@ -98,34 +104,30 @@ void *G_Alloc( int size )
if( ptr )
{
- freemem -= allocsize;
- if( g_debugAlloc.integer )
- G_Printf( "G_Alloc of %i bytes (%i left)\n", allocsize, freemem );
+ freeMem -= allocsize;
memset( ptr, 0, allocsize );
*ptr++ = allocsize; // Store a copy of size for deallocation
return( (void *) ptr );
}
- G_Error( "G_Alloc: failed on allocation of %i bytes\n", size );
+ Com_Error( ERR_DROP, "BG_Alloc: failed on allocation of %i bytes\n", size );
return( NULL );
}
-void G_Free( void *ptr )
+void BG_Free( void *ptr )
{
// Release allocated memory, add it to the free list.
- struct freememnode *fmn;
+ freeMemNode_t *fmn;
char *freeend;
int *freeptr;
freeptr = ptr;
freeptr--;
- freemem += *freeptr;
- if( g_debugAlloc.integer )
- G_Printf( "G_Free of %i bytes (%i left)\n", *freeptr, freemem );
+ freeMem += *freeptr;
- for( fmn = freehead; fmn; fmn = fmn->next )
+ for( fmn = freeHead; fmn; fmn = fmn->next )
{
freeend = ((char *) fmn) + fmn->size;
if( freeend == (char *) freeptr )
@@ -138,42 +140,42 @@ void G_Free( void *ptr )
}
// No merging, add to head of list
- fmn = (struct freememnode *) freeptr;
+ fmn = (freeMemNode_t *) freeptr;
fmn->size = *freeptr; // Set this first to avoid corrupting *freeptr
fmn->cookie = FREEMEMCOOKIE;
fmn->prev = NULL;
- fmn->next = freehead;
- freehead->prev = fmn;
- freehead = fmn;
+ fmn->next = freeHead;
+ freeHead->prev = fmn;
+ freeHead = fmn;
}
-void G_InitMemory( void )
+void BG_InitMemory( void )
{
// Set up the initial node
- freehead = (struct freememnode *)memoryPool;
- freehead->cookie = FREEMEMCOOKIE;
- freehead->size = POOLSIZE;
- freehead->next = NULL;
- freehead->prev = NULL;
- freemem = sizeof( memoryPool );
+ freeHead = (freeMemNode_t *)memoryPool;
+ freeHead->cookie = FREEMEMCOOKIE;
+ freeHead->size = POOLSIZE;
+ freeHead->next = NULL;
+ freeHead->prev = NULL;
+ freeMem = sizeof( memoryPool );
}
-void G_DefragmentMemory( void )
+void BG_DefragmentMemory( void )
{
// If there's a frenzy of deallocation and we want to
// allocate something big, this is useful. Otherwise...
// not much use.
- struct freememnode *startfmn, *endfmn, *fmn;
+ freeMemNode_t *startfmn, *endfmn, *fmn;
- for( startfmn = freehead; startfmn; )
+ for( startfmn = freeHead; startfmn; )
{
- endfmn = (struct freememnode *)(((char *) startfmn) + startfmn->size);
- for( fmn = freehead; fmn; )
+ endfmn = (freeMemNode_t *)(((char *) startfmn) + startfmn->size);
+ for( fmn = freeHead; fmn; )
{
if( fmn->cookie != FREEMEMCOOKIE )
- G_Error( "G_DefragmentMemory: Memory corruption detected!\n" );
+ Com_Error( ERR_DROP, "BG_DefragmentMemory: Memory corruption detected!\n" );
if( fmn == endfmn )
{
@@ -184,12 +186,12 @@ void G_DefragmentMemory( void )
if( fmn->next )
{
if( !(fmn->next->prev = fmn->prev) )
- freehead = fmn->next; // We're removing the head node
+ freeHead = fmn->next; // We're removing the head node
}
startfmn->size += fmn->size;
- memset( fmn, 0, sizeof(struct freememnode) ); // A redundant call, really.
+ memset( fmn, 0, sizeof(freeMemNode_t) ); // A redundant call, really.
- startfmn = freehead;
+ startfmn = freeHead;
endfmn = fmn = NULL; // Break out of current loop
}
else
@@ -200,17 +202,3 @@ void G_DefragmentMemory( void )
startfmn = startfmn->next; // endfmn acts as a 'restart' flag here
}
}
-
-void Svcmd_GameMem_f( void )
-{
- // Give a breakdown of memory
-
- struct freememnode *fmn;
-
- G_Printf( "Game memory status: %i out of %i bytes allocated\n", POOLSIZE - freemem, POOLSIZE );
-
- for( fmn = freehead; fmn; fmn = fmn->next )
- G_Printf( " %dd: %d bytes free.\n", fmn, fmn->size );
- G_Printf( "Status complete.\n" );
-}
-
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 0802951c..57a76f79 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -1311,6 +1311,11 @@ typedef enum
// this avoids having to set eFlags and eventNum
} entityType_t;
+void *BG_Alloc( int size );
+void BG_InitMemory( void );
+void BG_Free( void *ptr );
+void BG_DefragmentMemory( void );
+
void BG_EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result );
void BG_EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t result );
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index b99fdea7..3a25e248 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -535,12 +535,12 @@ static void admin_default_levels( void )
for( i = 0; i < MAX_ADMIN_LEVELS && g_admin_levels[ i ]; i++ )
{
- G_Free( g_admin_levels[ i ] );
+ BG_Free( g_admin_levels[ i ] );
g_admin_levels[ i ] = NULL;
}
for( i = 0; i <= 5; i++ )
{
- l = G_Alloc( sizeof( g_admin_level_t ) );
+ l = BG_Alloc( sizeof( g_admin_level_t ) );
l->level = i;
*l->name = '\0';
*l->flags = '\0';
@@ -991,7 +991,7 @@ void G_admin_namelog_cleanup( )
for( i = 0; i < MAX_ADMIN_NAMELOGS && g_admin_namelog[ i ]; i++ )
{
- G_Free( g_admin_namelog[ i ] );
+ BG_Free( g_admin_namelog[ i ] );
g_admin_namelog[ i ] = NULL;
}
}
@@ -1044,7 +1044,7 @@ void G_admin_namelog_update( gclient_t *client, qboolean disconnect )
G_Printf( "G_admin_namelog_update: warning, g_admin_namelogs overflow\n" );
return;
}
- namelog = G_Alloc( sizeof( g_admin_namelog_t ) );
+ namelog = BG_Alloc( sizeof( g_admin_namelog_t ) );
memset( namelog, 0, sizeof( namelog ) );
for( j = 0; j < MAX_ADMIN_NAMELOG_NAMES; j++ )
namelog->name[ j ][ 0 ] = '\0';
@@ -1088,7 +1088,7 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg )
admin_default_levels();
return qfalse;
}
- cnf = G_Alloc( len + 1 );
+ cnf = BG_Alloc( len + 1 );
cnf2 = cnf;
trap_FS_Read( cnf, len, f );
*( cnf + len ) = '\0';
@@ -1250,7 +1250,7 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg )
{
if( lc >= MAX_ADMIN_LEVELS )
return qfalse;
- l = G_Alloc( sizeof( g_admin_level_t ) );
+ l = BG_Alloc( sizeof( g_admin_level_t ) );
l->level = 0;
*l->name = '\0';
*l->flags = '\0';
@@ -1260,7 +1260,7 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg )
{
if( ac >= MAX_ADMIN_ADMINS )
return qfalse;
- a = G_Alloc( sizeof( g_admin_admin_t ) );
+ a = BG_Alloc( sizeof( g_admin_admin_t ) );
*a->name = '\0';
*a->guid = '\0';
a->level = 0;
@@ -1271,7 +1271,7 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg )
{
if( bc >= MAX_ADMIN_BANS )
return qfalse;
- b = G_Alloc( sizeof( g_admin_ban_t ) );
+ b = BG_Alloc( sizeof( g_admin_ban_t ) );
*b->name = '\0';
*b->guid = '\0';
*b->ip = '\0';
@@ -1284,7 +1284,7 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg )
{
if( cc >= MAX_ADMIN_COMMANDS )
return qfalse;
- c = G_Alloc( sizeof( g_admin_command_t ) );
+ c = BG_Alloc( sizeof( g_admin_command_t ) );
*c->command = '\0';
*c->exec = '\0';
*c->desc = '\0';
@@ -1301,7 +1301,7 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg )
g_admin_bans[ bc++ ] = b;
if( command_open )
g_admin_commands[ cc++ ] = c;
- G_Free( cnf2 );
+ BG_Free( cnf2 );
ADMP( va( "^3!readconfig: ^7loaded %d levels, %d admins, %d bans, %d commands\n",
lc, ac, bc, cc ) );
if( lc == 0 )
@@ -1502,7 +1502,7 @@ qboolean G_admin_setlevel( gentity_t *ent, int skiparg )
ADMP( "^3!setlevel: ^7too many admins\n" );
return qfalse;
}
- a = G_Alloc( sizeof( g_admin_admin_t ) );
+ a = BG_Alloc( sizeof( g_admin_admin_t ) );
a->level = l;
Q_strncpyz( a->name, adminname, sizeof( a->name ) );
Q_strncpyz( a->guid, guid, sizeof( a->guid ) );
@@ -1537,7 +1537,7 @@ static qboolean admin_create_ban( gentity_t *ent,
int i;
t = trap_RealTime( &qt );
- b = G_Alloc( sizeof( g_admin_ban_t ) );
+ b = BG_Alloc( sizeof( g_admin_ban_t ) );
if( !b )
return qfalse;
@@ -1569,7 +1569,7 @@ static qboolean admin_create_ban( gentity_t *ent,
if( i == MAX_ADMIN_BANS )
{
ADMP( "^3!ban: ^7too many bans\n" );
- G_Free( b );
+ BG_Free( b );
return qfalse;
}
g_admin_bans[ i ] = b;
@@ -2997,22 +2997,22 @@ void G_admin_cleanup()
for( i = 0; i < MAX_ADMIN_LEVELS && g_admin_levels[ i ]; i++ )
{
- G_Free( g_admin_levels[ i ] );
+ BG_Free( g_admin_levels[ i ] );
g_admin_levels[ i ] = NULL;
}
for( i = 0; i < MAX_ADMIN_ADMINS && g_admin_admins[ i ]; i++ )
{
- G_Free( g_admin_admins[ i ] );
+ BG_Free( g_admin_admins[ i ] );
g_admin_admins[ i ] = NULL;
}
for( i = 0; i < MAX_ADMIN_BANS && g_admin_bans[ i ]; i++ )
{
- G_Free( g_admin_bans[ i ] );
+ BG_Free( g_admin_bans[ i ] );
g_admin_bans[ i ] = NULL;
}
for( i = 0; i < MAX_ADMIN_COMMANDS && g_admin_commands[ i ]; i++ )
{
- G_Free( g_admin_commands[ i ] );
+ BG_Free( g_admin_commands[ i ] );
g_admin_commands[ i ] = NULL;
}
}
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index bad5e157..c8d07e4c 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -3728,7 +3728,7 @@ void G_LayoutLoad( void )
G_Printf( "ERROR: layout %s could not be opened\n", level.layout );
return;
}
- layout = G_Alloc( len + 1 );
+ layout = BG_Alloc( len + 1 );
trap_FS_Read( layout, len, f );
*( layout + len ) = '\0';
trap_FS_FCloseFile( f );
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 8ca87f5a..8cc6807c 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -989,15 +989,6 @@ void TeamplayInfoMessage( gentity_t *ent );
void CheckTeamStatus( void );
//
-// g_mem.c
-//
-void *G_Alloc( int size );
-void G_InitMemory( void );
-void G_Free( void *ptr );
-void G_DefragmentMemory( void );
-void Svcmd_GameMem_f( void );
-
-//
// g_session.c
//
void G_ReadSessionData( gclient_t *client );
@@ -1123,7 +1114,6 @@ extern vmCvar_t g_knockback;
extern vmCvar_t g_quadfactor;
extern vmCvar_t g_inactivity;
extern vmCvar_t g_debugMove;
-extern vmCvar_t g_debugAlloc;
extern vmCvar_t g_debugDamage;
extern vmCvar_t g_weaponRespawn;
extern vmCvar_t g_weaponTeamRespawn;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 9140dff8..08d1b455 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -60,7 +60,6 @@ vmCvar_t g_quadfactor;
vmCvar_t g_inactivity;
vmCvar_t g_debugMove;
vmCvar_t g_debugDamage;
-vmCvar_t g_debugAlloc;
vmCvar_t g_weaponRespawn;
vmCvar_t g_weaponTeamRespawn;
vmCvar_t g_motd;
@@ -190,7 +189,6 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_inactivity, "g_inactivity", "0", 0, 0, qtrue },
{ &g_debugMove, "g_debugMove", "0", 0, 0, qfalse },
{ &g_debugDamage, "g_debugDamage", "0", 0, 0, qfalse },
- { &g_debugAlloc, "g_debugAlloc", "0", 0, 0, qfalse },
{ &g_motd, "g_motd", "", 0, 0, qfalse },
{ &g_blood, "com_blood", "1", 0, 0, qfalse },
@@ -533,7 +531,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart )
G_ProcessIPBans( );
- G_InitMemory( );
+ BG_InitMemory( );
// set some level globals
memset( &level, 0, sizeof( level ) );
diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c
index 37ef22f0..07e3407f 100644
--- a/src/game/g_spawn.c
+++ b/src/game/g_spawn.c
@@ -370,7 +370,7 @@ char *G_NewString( const char *string )
l = strlen( string ) + 1;
- newb = G_Alloc( l );
+ newb = BG_Alloc( l );
new_p = newb;
diff --git a/src/game/g_svcmds.c b/src/game/g_svcmds.c
index 7cf3a97d..4cb3d991 100644
--- a/src/game/g_svcmds.c
+++ b/src/game/g_svcmds.c
@@ -600,12 +600,6 @@ qboolean ConsoleCommand( void )
return qtrue;
}
- if( Q_stricmp( cmd, "game_memory" ) == 0 )
- {
- Svcmd_GameMem_f( );
- return qtrue;
- }
-
if( Q_stricmp( cmd, "addip" ) == 0 )
{
Svcmd_AddIP_f( );