Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

GC is shit

Name: Anonymous 2012-01-09 14:49

Why don't compilers just automatically put frees in source code instead of collecting garbage at runtime?

Name: Anonymous 2012-01-09 16:13

That's reference counting, but not automatic memory management.

I.e, instead of

{
 obj = CreateSomeObject(..);
 // do something with obj
 // but don't forget to free the memory before a leak occurs!
 free(obj);
}

It should be, in an ideal world without GC and no free():

{
 obj = CreateSomeObject(...);
 // do something with obj
 // fuck free(), the compiler should auto-insert free(obj)
 // when the object is not in scope anymore.
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List