1 /*--------------------------------------------------------------------------
2
3 REVERSEM :
4
5 UNIT : HEAP CLASS
6
7 COPYRIGHT (C) 1994 Erich P. Gatejen ALL RIGHTS RESERVED
8 This is Freeware. You may distribute it as you wish. However, you may not
9 distribute a modified version without my consent.
10
11 Feel free to cut and paste any algorthm.
12
13 NOTE: XTILE is (C) 1992, 1994 by myself. It is NOT freeware. You may use
14 it for personal projects, but otherwise, it is not to be distributed
15 outside this REVERSEM package. (Contact me if you wish to do
16 otherwise)
17
18 ---------------------------------------------------------------------------*/
19
20 #define MAX_ZONES 5
21 #define MAX_ZONESIZE 65530
22
23 class Heap {
24
25 unsigned int ObjectSize;
26 char* Zones[MAX_ZONES]; // char must = 1 byte
27
28 char* NextSlot;
29
30 unsigned int SlotsLeft;
31
32 unsigned int CurrentZone;
33 unsigned int ZoneSlots;
34
35 public:
36
37 Heap( unsigned int Size );
38 ~Heap( void );
39
40 void* Allocate( void );
41 void Reset( void );
42
43 };
|