int serverlist_viewcount = 0;
serverlist_entry_t *serverlist_viewlist[SERVERLIST_VIEWLISTSIZE];
-int serverlist_cachecount;
-serverlist_entry_t serverlist_cache[SERVERLIST_TOTALSIZE];
+int serverlist_maxcachecount = 0;
+int serverlist_cachecount = 0;
+serverlist_entry_t *serverlist_cache = NULL;
qboolean serverlist_consoleoutput;
static void _ServerList_Test(void)
{
int i;
+ if (serverlist_maxcachecount <= 1024)
+ {
+ serverlist_maxcachecount = 1024;
+ serverlist_cache = (serverlist_entry_t *)Mem_Realloc(netconn_mempool, (void *)serverlist_cache, sizeof(serverlist_entry_t) * serverlist_maxcachecount);
+ }
for( i = 0 ; i < 1024 ; i++ ) {
memset( &serverlist_cache[serverlist_cachecount], 0, sizeof( serverlist_entry_t ) );
serverlist_cache[serverlist_cachecount].info.ping = 1000 + 1024 - i;
serverreplycount = 0;
serverlist_cachecount = 0;
serverlist_viewcount = 0;
+ serverlist_maxcachecount = 0;
+ serverlist_cache = (serverlist_entry_t *)Mem_Realloc(netconn_mempool, (void *)serverlist_cache, sizeof(serverlist_entry_t) * serverlist_maxcachecount);
} else {
// refresh all entries
int n;
if (serverlist_cachecount == SERVERLIST_TOTALSIZE)
return -1;
+ if (serverlist_maxcachecount <= serverlist_cachecount)
+ {
+ serverlist_maxcachecount += 64;
+ serverlist_cache = (serverlist_entry_t *)Mem_Realloc(netconn_mempool, (void *)serverlist_cache, sizeof(serverlist_entry_t) * serverlist_maxcachecount);
+ }
entry = &serverlist_cache[n];
memset(entry, 0, sizeof(*entry));
if( !strcmp( ipstring, serverlist_cache[ n ].info.cname ) )
break;
- entry = &serverlist_cache[n];
-
if( n < serverlist_cachecount ) {
// the entry has already been queried once or
return true;
}
+ if (serverlist_maxcachecount <= n)
+ {
+ serverlist_maxcachecount += 64;
+ serverlist_cache = (serverlist_entry_t *)Mem_Realloc(netconn_mempool, (void *)serverlist_cache, sizeof(serverlist_entry_t) * serverlist_maxcachecount);
+ }
+
+ entry = &serverlist_cache[n];
+
memset(entry, 0, sizeof(entry));
entry->protocol = protocol;
// store the data the engine cares about (address and ping)
//============================================================================
#define PRVM_OP_STATE 1
+#ifdef DP_SMALLMEMORY
+#define PRVM_MAX_STACK_DEPTH 128
+#define PRVM_LOCALSTACK_SIZE 2048
+
+#define PRVM_MAX_OPENFILES 16
+#define PRVM_MAX_OPENSEARCHES 8
+#define PRVM_MAX_GECKOINSTANCES 1
+#else
#define PRVM_MAX_STACK_DEPTH 1024
#define PRVM_LOCALSTACK_SIZE 16384
#define PRVM_MAX_OPENFILES 256
#define PRVM_MAX_OPENSEARCHES 128
#define PRVM_MAX_GECKOINSTANCES 32
+#endif
typedef void (*prvm_builtin_t) (void);