Garbage collection in SML, Java, C, Pascal

Why is garbage collection rarely mentioned in languages ​​like Pascal and C, while it is very important in SML and Java?

+5
source share
1 answer

Pascal and C traditionally do not use garbage collection. Instead, they used manual memory management ( malloc/ freefor C and new/ disposein Pascal).

Garbage collection can be added in most languages ​​that do not have them, but often at significant cost. An example of a garbage collector for C / C ++ is the Boehm GC .

Java, on the other hand, was designed with garbage collection from scratch.

+9

All Articles