From d29e73f05afa62a514e1156afa2fb40abae6346e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 22 Sep 2005 12:58:46 +0000 Subject: Use a new PU_FREE tag to mark free blocks, rather than the 'user' field (avoids using magic numbers to mark allocated blocks with no user) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 119 --- src/z_zone.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/z_zone.h') diff --git a/src/z_zone.h b/src/z_zone.h index 03b008e2..ec58b282 100644 --- a/src/z_zone.h +++ b/src/z_zone.h @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: z_zone.h 8 2005-07-23 16:44:57Z fraggle $ +// $Id: z_zone.h 119 2005-09-22 12:58:46Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -40,12 +40,14 @@ // ZONE MEMORY // PU - purge tags. // Tags < 100 are not overwritten until freed. -#define PU_STATIC 1 // static entire execution time -#define PU_SOUND 2 // static while playing -#define PU_MUSIC 3 // static while playing -#define PU_DAVE 4 // anything else Dave wants static -#define PU_LEVEL 50 // static until level exited -#define PU_LEVSPEC 51 // a special thinker in a level +#define PU_STATIC 1 /* static entire execution time */ +#define PU_SOUND 2 /* static while playing */ +#define PU_MUSIC 3 /* static while playing */ +#define PU_DAVE 4 /* anything else Dave wants static */ +#define PU_FREE 5 /* a free block */ +#define PU_LEVEL 50 /* static until level exited */ +#define PU_LEVSPEC 51 /* a special thinker in a level */ + // Tags >= 100 are purgable whenever needed. #define PU_PURGELEVEL 100 #define PU_CACHE 101 @@ -65,8 +67,8 @@ int Z_FreeMemory (void); typedef struct memblock_s { int size; // including the header and possibly tiny fragments - void** user; // NULL if a free block - int tag; // purgelevel + void** user; + int tag; // PU_FREE if this is free int id; // should be ZONEID struct memblock_s* next; struct memblock_s* prev; @@ -89,6 +91,10 @@ typedef struct memblock_s //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.3 2005/09/22 12:58:46 fraggle +// Use a new PU_FREE tag to mark free blocks, rather than the 'user' field +// (avoids using magic numbers to mark allocated blocks with no user) +// // Revision 1.2 2005/07/23 16:44:57 fraggle // Update copyright to GNU GPL // -- cgit v1.2.3