DOSBox-X
|
00001 00002 #include "dosbox.h" 00003 00004 #include <vector> 00005 #include <string> 00006 00007 #ifndef DOSBOX_REGIONALLOCTRACKING_H 00008 #define DOSBOX_REGIONALLOCTRACKING_H 00009 00010 /* rombios memory block */ 00011 class RegionAllocTracking { 00012 public: 00013 class Block { 00014 public: 00015 Block(); 00016 public: 00017 std::string who; 00018 Bitu start; /* start-end of the block inclusive */ 00019 Bitu end; 00020 bool free; 00021 }; 00022 public: 00023 RegionAllocTracking(); 00024 public: 00025 Bitu getMemory(Bitu bytes,const char *who,Bitu alignment,Bitu must_be_at); 00026 void initSetRange(Bitu start,Bitu end); 00027 Bitu freeUnusedMinToLoc(Bitu phys); 00028 bool freeMemory(Bitu offset); 00029 Bitu getMinAddress(); 00030 void compactFree(); 00031 void sanityCheck(); 00032 void logDump(); 00033 public: 00034 std::string name; 00035 std::vector<Block> alist; 00036 Bitu _min,_max; 00037 bool topDownAlloc; 00038 public: 00039 static const Bitu alloc_failed = ~((Bitu)0); 00040 }; 00041 00042 #endif /* DOSBOX_REGIONALLOCTRACKING_H */ 00043