mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 06:42:26 +00:00
zone.c: Remove unnecessary code -- zone isn't used anymore, so it
shouldn't be allocated on the hunk. sv_main.c: Change default timekick fuzz to 1.5 percent from 1 percent. Should cut down on people getting kicked for lag.
This commit is contained in:
parent
728a5dfc47
commit
1cf0aff856
2 changed files with 6 additions and 44 deletions
|
@ -1386,9 +1386,9 @@ void SV_InitLocal (void)
|
|||
|
||||
sv_aim = Cvar_Get("sv_aim", "2", CVAR_NONE, "None");
|
||||
|
||||
sv_timekick = Cvar_Get("sv_timekick", "3", CVAR_NONE, "None");
|
||||
sv_timekick_fuzz = Cvar_Get("sv_timekick_fuzz", "10", CVAR_NONE, "None");
|
||||
sv_timekick_interval = Cvar_Get("sv_timekick_interval", "30", CVAR_NONE, "None");
|
||||
sv_timekick = Cvar_Get("sv_timekick", "3", CVAR_NONE, "Time cheat protection");
|
||||
sv_timekick_fuzz = Cvar_Get("sv_timekick_fuzz", "15", CVAR_NONE, "Time cheat \"fuzz factor\"");
|
||||
sv_timekick_interval = Cvar_Get("sv_timekick_interval", "30", CVAR_NONE, "Time cheat check interval");
|
||||
|
||||
filterban = Cvar_Get("filterban", "1", CVAR_NONE, "None");
|
||||
|
||||
|
|
|
@ -40,26 +40,11 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#define DYNAMIC_SIZE 0x20000
|
||||
#define ZONEID 0x1d4a11
|
||||
#define HUNK_SENTINAL 0x1df001ed
|
||||
|
||||
#define ZONEID 0x1d4a11
|
||||
#define MINFRAGMENT 64
|
||||
|
||||
typedef struct memblock_s
|
||||
{
|
||||
int size; // including the header and possibly tiny fragments
|
||||
int tag; // a tag of 0 is a free block
|
||||
int id; // should be ZONEID
|
||||
struct memblock_s *next, *prev;
|
||||
int pad; // pad to 64 bit boundary
|
||||
} memblock_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int size; // total bytes malloced, including header
|
||||
memblock_t blocklist; // start / end cap for linked list
|
||||
memblock_t *rover;
|
||||
} memzone_t;
|
||||
|
||||
void Cache_FreeLow (int new_low_hunk);
|
||||
void Cache_FreeHigh (int new_high_hunk);
|
||||
|
||||
|
@ -67,24 +52,13 @@ void Cache_FreeHigh (int new_high_hunk);
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
ZONE MEMORY ALLOCATION
|
||||
|
||||
There is never any space between memblocks, and there will never be two
|
||||
contiguous free memblocks.
|
||||
|
||||
The rover can be left pointing at a non-empty block
|
||||
|
||||
The zone calls are pretty much only used for small strings and structures,
|
||||
all big things are allocated on the hunk.
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
memzone_t *mainzone;
|
||||
|
||||
//============================================================================
|
||||
|
||||
#define HUNK_SENTINAL 0x1df001ed
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int sentinal;
|
||||
|
@ -117,7 +91,7 @@ void Hunk_Check (void)
|
|||
for (h = (hunk_t *)hunk_base ; (byte *)h != hunk_base + hunk_low_used ; )
|
||||
{
|
||||
if (h->sentinal != HUNK_SENTINAL)
|
||||
Sys_Error ("Hunk_Check: trahsed sentinal");
|
||||
Sys_Error ("Hunk_Check: trashed sentinal");
|
||||
if (h->size < 16 || h->size + (byte *)h - hunk_base > hunk_size)
|
||||
Sys_Error ("Hunk_Check: bad size");
|
||||
h = (hunk_t *)((byte *)h+h->size);
|
||||
|
@ -737,23 +711,11 @@ Memory_Init
|
|||
*/
|
||||
void Memory_Init (void *buf, int size)
|
||||
{
|
||||
int p;
|
||||
int zonesize = DYNAMIC_SIZE;
|
||||
|
||||
hunk_base = buf;
|
||||
hunk_size = size;
|
||||
hunk_low_used = 0;
|
||||
hunk_high_used = 0;
|
||||
|
||||
Cache_Init ();
|
||||
p = COM_CheckParm ("-zone");
|
||||
if (p)
|
||||
{
|
||||
if (p < com_argc-1)
|
||||
zonesize = atoi (com_argv[p+1]) * 1024;
|
||||
else
|
||||
Sys_Error ("Memory_Init: you must specify a size in KB after -zone");
|
||||
}
|
||||
mainzone = Hunk_AllocName ( zonesize, "zone" );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue