英文:
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的垃圾回收器。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论