# Correct the needed linklibs in curl-config also.
[AROS-Contrib.git] / Games / Doom / z_zone.h
blob2d2989a1473c685944eb458d188442f11566c167
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
15 // for more details.
17 // DESCRIPTION:
18 // Zone Memory Allocation, perhaps NeXT ObjectiveC inspired.
19 // Remark: this was the only stuff that, according
20 // to John Carmack, might have been useful for
21 // Quake.
23 //---------------------------------------------------------------------
27 #ifndef __Z_ZONE__
28 #define __Z_ZONE__
30 #include <stdio.h>
33 // ZONE MEMORY
34 // PU - purge tags.
35 // Tags < 100 are not overwritten until freed.
36 #define PU_STATIC 1 // static entire execution time
37 #define PU_SOUND 2 // static while playing
38 #define PU_MUSIC 3 // static while playing
39 #define PU_DAVE 4 // anything else Dave wants static
40 #define PU_LEVEL 50 // static until level exited
41 #define PU_LEVSPEC 51 // a special thinker in a level
42 // Tags >= 100 are purgable whenever needed.
43 #define PU_PURGELEVEL 100
44 #define PU_CACHE 101
47 void Z_Init (void);
48 void* Z_Malloc (int size, int tag, void *ptr);
49 void Z_Free (void *ptr);
50 void Z_FreeTags (int lowtag, int hightag);
51 void Z_DumpHeap (int lowtag, int hightag);
52 void Z_FileDumpHeap (FILE *f);
53 void Z_CheckHeap (void);
54 void Z_ChangeTag2 (void *ptr, int tag);
55 int Z_FreeMemory (void);
58 typedef struct memblock_s
60 int size; // including the header and possibly tiny fragments
61 void** user; // NULL if a free block
62 int tag; // purgelevel
63 int id; // should be ZONEID
64 struct memblock_s* next;
65 struct memblock_s* prev;
66 int pad1;
67 int pad2;
68 } memblock_t;
71 // This is used to get the local FILE:LINE info from CPP
72 // prior to really call the function in question.
74 #define Z_ChangeTag(p,t) \
75 { \
76 if (( (memblock_t *)( (byte *)(p) - sizeof(memblock_t)))->id!=0x1d4a11) \
77 I_Error("Z_CT at "__FILE__":%i",__LINE__); \
78 Z_ChangeTag2(p,t); \
81 //#define Z_ChangeTag(p,t) Z_ChangeTag2(p,t)
84 #endif
85 //-----------------------------------------------------------------------------
87 // $Log$
88 // Revision 1.1 2000/02/29 18:21:07 stegerg
89 // Doom port based on ADoomPPC. Read README.AROS!
92 //-----------------------------------------------------------------------------