开发者

Garbage collection in SML, Java, C, Pascal

开发者 https://www.devze.com 2023-03-02 21:48 出处:网络
Why is garbage col开发者_开发知识库lection rarely spoken about in languages such as Pascal and C, whereas it is very important in SML and Java?Pascal and C don\'t traditionally use garbage collections

Why is garbage col开发者_开发知识库lection rarely spoken about in languages such as Pascal and C, whereas it is very important in SML and Java?


Pascal and C don't traditionally use garbage collections. They used manual memory management instead (malloc/free for C and new/dispose in Pascal).

Garbage collection can be added in most languages that don't have them, but often with considerable expenses. An example of a garbage collector for C/C++ is the Boehm GC.

Java, on the other hand, has been designed with garbage collection from the ground up.

0

精彩评论

暂无评论...
验证码 换一张
取 消