I had the exact same thing happen to me. Took CS107 at Stanford; cap stone project was a heap allocator. I ended up expanding it post course completion and published what I thought was a more clever approach. A few months later, I got a pretty stern email from our professor (shoutout to Julie Zelenski who was amazing) asking me to take it down :( Luckily i didn't get in trouble for this. kinda dumb on my part in retrospect.
What reason would your professor have to have you take it down, at least past your due date? One could claim copyright on the project itself if you shared the files, or if you kept the original framework a course might provide, but the work you did is yours.
It's not like heap allocators are hard to come by, there's one right there in the Linux source code.
I've had plenty of courses where professors were afraid of answer sheets leaking out because they intended to use the exact same tests and practicals the year after. Those were always the courses where someone had a copy of last year's answers that was passed around between groups of students. You can't rely on secrecy to save yourself from having to come up with different tests if you hand out a piece of paper to 50 or even 300 people.
The idea that someone would reach out to you and actually expect that you would take something down because students were using it is absurd. It shows a lack of understanding of both how the internet works, and more so the idea that an action like this is really improving the outcome of the students. If the student outcome depends on you taking something OFF the internet, that is the problem.
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?