1.1 --- a/memory_map.h Wed Feb 03 22:22:30 2021 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,51 +0,0 @@
1.4 -#pragma once
1.5 -
1.6 -#include <map>
1.7 -#include <mutex>
1.8 -#include <sstream>
1.9 -
1.10 -#include "region.h"
1.11 -#include "types.h"
1.12 -
1.13 -
1.14 -
1.15 -/* Memory map entry. */
1.16 -
1.17 -typedef std::map<offset_t, Region *> _MemoryMap;
1.18 -typedef std::pair<offset_t, Region *> _MemoryMapEntry;
1.19 -
1.20 -
1.21 -
1.22 -/* Memory organised as a collection of regions. */
1.23 -
1.24 -class MemoryMap
1.25 -{
1.26 -protected:
1.27 - std::mutex _lock;
1.28 - _MemoryMap _regions;
1.29 -
1.30 -public:
1.31 - /* Region maintenance. */
1.32 -
1.33 - void insert(Region *region);
1.34 -
1.35 - void remove(Region *region);
1.36 -
1.37 - /* Debugging methods. */
1.38 -
1.39 - void show(std::ostringstream &buffer);
1.40 -};
1.41 -
1.42 -
1.43 -
1.44 -/* An allocator abstraction. */
1.45 -
1.46 -class Allocator : public MemoryMap
1.47 -{
1.48 -public:
1.49 - Region *region(offset_t size);
1.50 -
1.51 - void release(Region *region);
1.52 -};
1.53 -
1.54 -// vim: tabstop=4 expandtab shiftwidth=4