Discussion:
How does free( ) function know how many bytes to free?
(too old to reply)
Abhishek
2007-03-22 16:52:06 UTC
Permalink
Hello,

How does the free(ptr) know how many bytes of memory starting
address ptr pointing to should it free? Is this information stored at
any address or in any table? Is there any resource where I can get
more information from. Is this method used dependant on the compiler
as well?

With Regards,
Abhishek S
Keith Thompson
2007-03-22 18:01:37 UTC
Permalink
Post by Abhishek
How does the free(ptr) know how many bytes of memory starting
address ptr pointing to should it free? Is this information stored at
any address or in any table? Is there any resource where I can get
more information from. Is this method used dependant on the compiler
as well?
The comp.lang.c FAQ is at <http://www.c-faq.com/>. You've just asked
question 7.26.

Your question, if it hadn't already been answered in the FAQ, would
have been more appropriate for comp.lang.c rather than comp.std.c.
--
Keith Thompson (The_Other_Keith) kst-***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Loading...