This project must target a Unix platform and execute properly on our CS1 server.
The project must be written in C, C++, or Java.
Problem Overview
This project will simulate the buddy system of performing memory allocations.
The project will allow the user to input a set of memory requests and releases. It will output a representation of memory showing occupied and free spaces.
Design
You may design your own implementation approach, but here are a few constraints.
The memory space is 1 megabyte (1024*1024 bytes). Your program should read in a list of requests from a space-delimited text file named input.txt. The format of the text file should have one request per line. A request can either be a request to allocate memory or to release memory. For an allocation request, the format is “Request size” where size is in kilobytes. The request should be assigned a name alphabetically (first request is A). For a release, the format is “Release name” where name is the alphabetically assigned name of a prior request.
You can assume the input file format is valid. If a request cannot be satisfied, the program should exit with an error. The program should support requests as small as 64K.
Your output should be a graphical representation of memory as shown in the output section. This can be output as text, or you can draw it graphically using a graphics package such as JavaFX.
Your program should be able to reproduce the example shown in the slides as well as any similar set of requests.