Luckily you didn't get into trouble? It's the professor's responsibility to stop their students cheating, not yours! Heap allocators are hardly unique and the internet is full of source code.
It's really time to stop considering degrees evidence of anything. Universities let students cheat, they let professors cheat. What does having a good degree really prove? Why does anyone still ask for one?