Skip to content
Snippets Groups Projects
Commit cf775563 authored by j2-mcdaid's avatar j2-mcdaid :skull_crossbones:
Browse files

Update READme.md

parent a2b2c198
No related branches found
No related tags found
No related merge requests found
<h1>Task 1<h1>
[Worksheet 2](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/tree/main/Worksheets/Worksheet2) | [Task 2](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/tree/main/Worksheets/Worksheet2/Task%202) | [Task 3](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/tree/main/Worksheets/Worksheet2/Task%203)
\ No newline at end of file
<h1>Task 1</h1>
[Worksheet 2](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/tree/main/Worksheets/Worksheet2) | [Task 2](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/tree/main/Worksheets/Worksheet2/Task%202) | [Task 3](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/tree/main/Worksheets/Worksheet2/Task%203) </br>
Task 1 required the construction of a bump allocator. This is a basic design and as such has many limitations such as only being able to free all memory at once. To create the allocator several key aspects are needed. As many smaller aspects of the design were covered in worksheet 1, the write up here will focus on overall design decisions and aspects not touched upon in worksheet 1.
<h3>Step 1 - Class design</h3>
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>
Allocator.hpp:</br>
![Allocator.hpp](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/raw/main/Worksheets/Worksheet2/images/task1_bAllocator_class.png "Allocator.hpp")</br>
Allocator.cpp:</br>
![Allocator.cpp](https://gitlab.uwe.ac.uk/j2-mcdaid/advanced-systems-programming/-/raw/main/Worksheets/Worksheet2/images/task1_bAllocator_define.png "Allocator.cpp")</br>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment