#ifndef ZONE_H
#define ZONE_H
+
#define POOLNAMESIZE 128
// give malloc padding so we can't waste most of a page at the end
#define MEMCLUMPSIZE (65536 - 1536)
#define MEMBITS (MEMCLUMPSIZE / MEMUNIT)
#define MEMBITINTS (MEMBITS / 32)
-#define MEMHEADER_SENTINEL 0xABADCAFE
-#define MEMCLUMP_SENTINEL 0xDEADF00D
+#define MEMHEADER_SENTINEL1 0xDEADF00D
+#define MEMHEADER_SENTINEL2 0xDF
+#define MEMCLUMP_SENTINEL 0xABADCAFE
typedef struct memheader_s
{
// file name and line where Mem_Alloc was called
char *filename;
int fileline;
- // should always be MEMHEADER_SENTINEL
+ // should always be MEMHEADER_SENTINEL1
int sentinel1;
- // immediately followed by data, which is followed by another MEMHEADER_SENTINEL
+ // immediately followed by data, which is followed by a MEMHEADER_SENTINEL2 byte
}
memheader_t;
typedef struct memclump_s
{
// contents of the clump
- byte block[MEMCLUMPSIZE];
+ qbyte block[MEMCLUMPSIZE];
// should always be MEMCLUMP_SENTINEL
int sentinel1;
// if a bit is on, it means that the MEMUNIT bytes it represents are
extern mempool_t *zonemempool;
#define Z_Malloc(size) Mem_Alloc(zonemempool,size)
#define Z_Free(data) Mem_Free(data)
+
#endif
+