Computer Science

Faculty of Engineering, LTH

Denna sida på svenska This page in English

Old Project: Heap Managers (Buddy and Linked List)

Working on and showing your project

  • according to informed sources, gawk version 3.x seems work best (avoid versions >= 4.0)
  • you may work on your project in pairs (as during the lab, or other pairs)
  • you will be asked questions individually - both group members should be able to answer
  • I will not be able to look at any projects before the first half of June
  • if you want to show your project, we'll do it based on appointments: send me a mail to establish a date and time when I can look at your project

Further clarification

  • there is no deadline for the project. you show it when it's done!
  • if you are not in Lund, you can show your projects via Skype
  • if you completed your project alone (i.e. not as a group) is enough with electronic submission (I will ask you questions by email)


  1. Your task is to implement two versions of malloc/calloc/realloc and free.
  2. One should be a linked-list implementation and the other an implementation of the buddy system.
  3. You need to use sbrk to allocate memory from the kernel on Linux for the list version and increment the heap size in suitable steps. For the buddy system, you are allowed to allocate a sufficiently large block at once.
  4. At a free, you must merge adjacent unallocated blocks in the list version and buddies in the buddy version.
  5. Your implementations should work with gawk. Use any version.
  6. Download gawk and type configure and make check.
  7. Then edit the Makefile to use your malloc implementation. To edit the Makefile, look for places where version is used and add your file in the same way.
  8. Then type make check again.
  9. Repeat for your other malloc implementation.
  10. Show your code to Flavius (see procedure above).