Arena Memory Allocator

Background


Tasks

  1. The first task in Assignment 3 is to implement an arena, and to write a simple test program to check that it works.

  2. The second task is to change your program from Assignment 1 to use your arena when possible. If you have a function which creates an object with memory allocated from malloc/calloc, you can add a similar function which has one more parameter, a pointer to an arena, and allocates the memory from the arena instead. Change you program's deallocation functions accordingly.

  3. Then compare the execution times of the program from A1 and the new program.

  4. Summarise in one sentence in a comment in your arena implementation when you can use an arena instead of malloc/free.