From Melodic Pig, 5 Years ago, written in Plain Text.
Embed
  1. #ifndef MAKEALLOCATOR_H
  2. #define MAKEALLOCATOR_H
  3.  
  4. #include <cstdlib>
  5.  
  6. typedef class Allocator
  7. {
  8.         private:
  9.         char* start = nullptr;
  10.         char* current = nullptr;
  11.         size_t max;
  12.         size_t curNum;
  13.        
  14.         public:
  15.         void makeAllocator(size_t maxSize);
  16.         char* alloc(size_t size);
  17.         void reset();
  18.         char* get_start();
  19.        
  20. } Allocator;
  21.  
  22. #endif