统一类型系统是否有助于进行垃圾收集 [英] Does Unified Type system help for doing garbage collection

查看:65
本文介绍了统一类型系统是否有助于进行垃圾收集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#具有统一的类型系统,其中所有类型(包括基本类型)都从object类型继承.

C# has a unified type system in which all types, including primitive types inherit from object type.

Java也具有从object类型继承的所有类.

Java also has all of its classes inherited from object type.

Thinking in java

单根的层次结构使实现垃圾变得更加容易 收藏家

A singly rooted hierarchy makes it much easier to implement a garbage collector


unified type systemsingle rooted hierarchy是否有助于进行垃圾收集,如果可以,如何?


Does,unified type system or single rooted hierarchy help for doing Garbage collection and if so how?

推荐答案

垃圾收集器唯一需要的是能够识别对象的大小以及对象中引用的位置(例如,根据类型)

The only thing which a garbage collector needs is to be able to identify the size of an object and where the references in the object are (e.g. from the type)

拥有一种确定方法,可以使其变得更加简单.

Having one way of determining this, can make it much simpler.

这篇关于统一类型系统是否有助于进行垃圾收集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆