在Go语言中,垃圾回收是如何进行的?

huangapple go评论76阅读模式
英文:

Garbage collection in golang - how does it happen?

问题

众所周知,Go语言是一种具有高效垃圾回收器的垃圾收集语言。

如果Go语言被编译成机器码并且没有运行时环境来管理内存释放,那么这是如何实现的呢?

英文:

It is known that go is garbage collected language and with a very efficient garbage collector.

How can that happen if go is compiled to machine code and has no run time environment that manages the memory deallocation?

答案1

得分: 2

一个Go程序是由多个包组成的,这些包会被编译然后链接在一起。其中一个包是runtime,它包含了Go的垃圾回收器。

请参阅目录 src/runtime/

英文:

A Go program is a collection of packages which are compiled and then linked together. One of these packages is runtime which includes the Go garbage collector.

See Directory src/runtime/

huangapple
  • 本文由 发表于 2015年10月17日 16:18:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/33184428.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定