1 #pragma once 2 3 #include <list> 4 #include <set> 5 6 #include "memory.h" 7 8 9 10 /* A memory pool preallocating its memory. */ 11 12 class MemoryPreallocated : public Memory 13 { 14 protected: 15 unsigned int _limit; 16 std::list<Region *> _free; 17 std::set<Region *> _used; 18 19 public: 20 explicit MemoryPreallocated(unsigned int limit, offset_t region_size=PAGE_SIZE); 21 22 virtual Region *region(); 23 24 virtual void release(Region *region); 25 }; 26 27 // vim: tabstop=4 expandtab shiftwidth=4