@@ -8,5 +8,35 @@ Task 1 required the construction of a bump allocator. This is a basic design and
...
@@ -8,5 +8,35 @@ Task 1 required the construction of a bump allocator. This is a basic design and
In this case the class design is relatively simple as the class only neeeds a handfull of attributes and methods. The attributes needed govern the start point and size of the heap, as well as the "next" pointer and the allocator count. The methods are almost as simple with standard destructor and constructor, with the allocator and deallocator being slightly more involved. The header file has been used to declare the attributes and methods while the methods have been defined within the allocator.cpp file. This follows convention and makes the code more parseable.<br/>
In this case the class design is relatively simple as the class only neeeds a handfull of attributes and methods. The attributes needed govern the start point and size of the heap, as well as the "next" pointer and the allocator count. The methods are almost as simple with standard destructor and constructor, with the allocator and deallocator being slightly more involved. The header file has been used to declare the attributes and methods while the methods have been defined within the allocator.cpp file. This follows convention and makes the code more parseable.<br/>
The allocator is in a template file in order to ensure type-safe allocations. It works through a couple of simple step; calculating memory needed, checking that there is enough memory, allocating the memory and incrementing the allocater counter.<br/>
There were several test needed to demonstrate certain functionality within the allocator. These were implemented within a basic user interface so that when ran the functionality could be chosen. It was implemented like this to ease testing and make the results more visually coherent. The code has not been proofed against incorrect user entry as it only serves as an example of functionality rather than as a program aimed to be used regularly.<br/>