free()

Michael J. Schmelzer mjschmel at phoenix.Princeton.EDU
Tue May 10 19:46:42 AEST 1988


When you free something you've malloc'ed, how does the compiler
keep track of how large a block you're freeing up?

Obviously, free() and malloc() are machine dependent. So specifically,
I'm working in Turbo C on an AT. Is it the compiler's job to keep
tabs on each block that gets allocated by malloc()? What if you just
freed a random block that wasn't allocated? (Big trouble, but why?)

If someone could explain what free() actually does, that would
help a great deal.

Thank a lot.
-- 
"Sum Iuppiter Optimus Maximus!!"- My Latin teacher who flipped. 
"Worthlessness is the root of all worthlessness." -WPRB music dept.
Mike Schmelzer mjschmel at phoenix!princeton.edu
DISLAIMER:If you think I speak for anyone but myself, you must be a lawyer.



More information about the Comp.lang.c mailing list