--- /dev/null
+/*
+ * PagedAllocator.h
+ *
+ * Created on: Oct 9, 2012
+ * Author: holy
+ */
+
+#ifndef LOADER_PAGEDALLOCATOR_H_
+#define LOADER_PAGEDALLOCATOR_H_
+
+#include <deque>
+
+namespace loader {
+
+class PagedAllocator {
+
+public:
+ explicit PagedAllocator(unsigned int pageSize);
+ ~PagedAllocator();
+private:
+ PagedAllocator(const PagedAllocator &);
+ PagedAllocator &operator =(const PagedAllocator &);
+
+public:
+ char *Alloc(unsigned int size);
+
+private:
+ unsigned int Free() const;
+ void NewPage();
+ char *CurrentPage();
+ const char *CurrentPage() const;
+
+private:
+ char *head;
+ std::deque<char *> pages;
+ const unsigned int pageSize;
+
+};
+
+}
+
+#endif /* LOADER_PAGEDALLOCATOR_H_ */