]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - zone.c
fix incredibly stupid bug in Memory_Init, it was clearing the pool chain AFTER alloca...
[xonotic/darkplaces.git] / zone.c
diff --git a/zone.c b/zone.c
index 02e5fa7088f83f31f6ee8f789065c3a647874f5e..39369d578a62668bac09c918cd89d6ae7ade41a4 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 
-cvar_t developer_memory = {0, "developer_memory", "0"};
-cvar_t developer_memorydebug = {0, "developer_memorydebug", "0"};
+cvar_t developer_memory = {0, "developer_memory", "0", "prints debugging information about memory allocations"};
+cvar_t developer_memorydebug = {0, "developer_memorydebug", "0", "enables memory corruption checks (very slow)"};
 
 mempool_t *poolchain = NULL;
 
@@ -461,9 +461,9 @@ Memory_Init
 */
 void Memory_Init (void)
 {
+       poolchain = NULL;
        tempmempool = Mem_AllocPool("Temporary Memory", POOLFLAG_TEMP, NULL);
        zonemempool = Mem_AllocPool("Zone", 0, NULL);
-       poolchain = NULL;
 }
 
 void Memory_Shutdown (void)
@@ -474,8 +474,8 @@ void Memory_Shutdown (void)
 
 void Memory_Init_Commands (void)
 {
-       Cmd_AddCommand ("memstats", MemStats_f);
-       Cmd_AddCommand ("memlist", MemList_f);
+       Cmd_AddCommand ("memstats", MemStats_f, "prints memory system statistics");
+       Cmd_AddCommand ("memlist", MemList_f, "prints memory pool information (and individual allocations if used as memlist all)");
        Cvar_RegisterVariable (&developer_memory);
        Cvar_RegisterVariable (&developer_memorydebug);
 }