Name: Anonymous 2012-01-09 14:49
Why don't compilers just automatically put frees in source code instead of collecting garbage at runtime?
{
obj = CreateSomeObject(..);
// do something with obj
// but don't forget to free the memory before a leak occurs!
free(obj);
}
{
obj = CreateSomeObject(...);
// do something with obj
// fuck free(), the compiler should auto-insert free(obj)
// when the object is not in scope anymore.
}