File: regionalloctracking.h

package info (click to toggle)
dosbox-x 2026.01.02%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 53,220 kB
  • sloc: cpp: 341,269; ansic: 165,494; sh: 1,463; makefile: 967; perl: 385; python: 106; asm: 57
file content (40 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#ifndef DOSBOX_REGIONALLOCTRACKING_H
#define DOSBOX_REGIONALLOCTRACKING_H

/* rombios memory block */
class RegionAllocTracking {
public:
	class Block {
public:
						Block();
public:
		std::string			who;
		Bitu				start;		/* start-end of the block inclusive */
		Bitu				end;
		bool				free;
		bool				fixed;
	};
public:
						RegionAllocTracking();
public:
	void					setMaxDynamicAllocationAddress(Bitu _new_max);
	Bitu					getMemory(Bitu bytes,const char *who,Bitu alignment,Bitu must_be_at);
	void					initSetRange(Bitu start,Bitu end);
	Bitu					freeUnusedMinToLoc(Bitu phys);
	bool					freeMemory(Bitu offset);
	Bitu					getMinAddress();	
	void					compactFree();
	void					sanityCheck();
	void					logDump();
public:
	std::string				name;
	std::vector<Block>			alist;
	Bitu					_min,_max;
	Bitu					_max_nonfixed; /* above this address, only permit fixed memory allocation */
	bool					topDownAlloc;
public:
	static const Bitu			alloc_failed = ~((Bitu)0);
};

#endif /* DOSBOX_REGIONALLOCTRACKING_H */