In grad school, one of our professors wrote a memory leak checker for C/C++ and sprung it on his compiler construction class two weeks from the end of the semester. He pronounced that no one with memory leaks in their project would pass his course. My friends were taking the class and everyone enrolled in it despaired of passing. As a joke, to try and bring some levity to the situation, I suggested that they just register every allocation they made on a huge list, then free everything right before program termination. Well, they were so desperate, they went and implemented it. Others in the class heard about this, and soon every single student enrolled in the class had implemented the same scheme.
Later on, I became the TA for that professor for the same compiler construction class. I don't think he knows to this day.
In grad school, one of our professors wrote a memory leak checker for C/C++ and sprung it on his compiler construction class two weeks from the end of the semester. He pronounced that no one with memory leaks in their project would pass his course. My friends were taking the class and everyone enrolled in it despaired of passing. As a joke, to try and bring some levity to the situation, I suggested that they just register every allocation they made on a huge list, then free everything right before program termination. Well, they were so desperate, they went and implemented it. Others in the class heard about this, and soon every single student enrolled in the class had implemented the same scheme.
Later on, I became the TA for that professor for the same compiler construction class. I don't think he knows to this day.