Default said:
But there is no sensible answer to this, other than,
"implementation-specific".
You are entitled to your opinion.
You can give whatever answers you like to the question.
There was nothing wrong with mine, given the lack of details.
Answer it yourself. Or don't. I don't care.
I stand by mine. If you don't like [it], tough.
Ed asked,
"When free() is used to free the memory allocated by malloc(),
how does it know the size of the memory to be freed?"
You answered, "Magic."
Ed asked,
"I guess I'm asking where does the info [get] stored?"
You answered,
"Someplace secret. None of your business, seriously.
How a particular implementation does it is highly platform-specific
and of little or no use to the programmer."
Do you really think this was helpful?
I expect students to be skeptical
and I think that they deserve, at least, a plausible explanation
of how such things might be implemented.
I think that you should familiarize yourself
with the notion of a "typical implementation"
if you want to help people learn
the C computer programming language.