illinois-cs241 / illinois-cs241.github.io

CS 241 course website
http://cs241.cs.illinois.edu
Other
28 stars 18 forks source link

Update heap checker doc with note to not strictly follow example #321

Open amaankhan02 opened 6 months ago

amaankhan02 commented 6 months ago

The heap checker documentation in malloc previously implied to students that they must use a next pointer in the metadata struct that points to the next physically adjacent block. Students thought that they have to implement their metadata struct in this manner, which made it harder for them to pass part 2 test cases.

I added a note at the end of the heap checker documentation simply stating that they do not have to conform to the implementation in the example, and that they are encouraged to try new implementations that they feel will have improved performance. I kept it vague so that it doesn't imply that they must follow any certain implementation and so that they are free to think and design something on their own.

Heasummn commented 6 months ago

This LGTM. Long term, I was thinking of recording a video walking through a few different heap checker examples/common bugs, as I noticed that a lot of students were struggling to adapt the heap checker to help verify their design.

For example, some students were actually using a next and prev pointer to represent the next physically adjacent block in memory but had buggy implementations of this, a heap_checker that verifies that every next pointer is increasing would've caught these. A short 10-15 minute video walking through something like this is probably better than making the MP spec even longer.