This is an archived copy of a previous semester's site.
Please see the current semester's site.
Looking to explore malloc
a bit more? This MP plus-plus is for you!
In your CS 340 directory, merge the initial starting files with the following commands:
git fetch release
git merge release/mp3pp --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 mp3pp
directory and optimize it to be as space efficient and past as possible on the five provided testers. Specifically, you must:
libc
malloc on all five testers, ANDlibc
’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
.
You only have to beat libc
malloc on the five testers; most students who succeed at this MP++ do so by optimizing for those cases. You may eventually be able to build a malloc that beats libc
’s in general, and possibly even have yours be adopted by libc
, but probably not as part of your first attempt at building an allocator.
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:
ActionTab
mp3-jklmnop autograding
Run Workflowbutton (located on the blue bar)
Run Workflow
MP plus-pluses award extra credit, but only if all tests (autograder
) pass.