MP 3: Alloc Too Well - JKLMNOP

Due Date: Completed, turned in via git, and GitHub Action completed before October 5, 2023 at 11:59pm
Extra Credit: This page describes extra credit to earn up to +5 EC.
Semester-Long Details: Programming Environment and MP Policy


Looking for to nerd out with malloc a bit more? This JKLMNOP is for you!

Initial Files

In your CS 340 directory, merge the initial starting files with the following commands:

git fetch release
git merge release/mp3-jklmnop --allow-unrelated-histories  -m "Merging initial files"


On a Linux system, the version of the alloc functions provided are VERY GOOD in the general case. This version of code provided on Linux systems of must handle programs that make small allocations, large allocations, and everything in between! Since it comes with the C programming library, this default malloc is commonly referred to as libc malloc.

One reason people make special-purpose memory allocators is to improve memory allocations for a subset of problems. Can you beat libc malloc for a specific subset of code?

Copy your existing alloc.c into the mp3-jklmnop directory and optimize it to be as space efficient and past as possible on the five provided testers. Specifically, you must:

  • Use less space than libc malloc on all five testers, AND
  • Among all five testers, run in less than 100% of libc’s time.

The provided test suite tests both of these conditions. If you get to the timed tests, you will find that a summary is printed for you to show how your alloc preformed relative to libc.

Submission and Grading


Once you have locally passed all the tests, you will need to submit and grade your code. First commit using the standard git commands:

git add -A
git commit -m "MP submission"
git push


The initial grading is done via a manual GitHub Action. You MUST complete this step before the deadline to earn any points for the MP:

  • Navigate to your repository on
  • Click on the “Action” Tab
  • Choose “mp3-jklmnop autograding”
  • Click the green “Run Workflow” button (located on the blue bar)
  • Press “Run Workflow”
  • You will trigger a GitHub Action that will complete the grading run!


The JKLMNOP is worth +5 points, awarded only if all tests (autograder) are successful.