Hi,

This is a good question, and I think it points out that the name of this
command line flag ("-enable-gc") is not ideal. It should really be
something more like "-enable-precise-stack-scan=<value>".

The garbage collector used by gollvm is substantially the same as the one
used by the main Go compiler. The main difference is that by default gollvm
uses conservative stack scanning -- chunks of stack memory are scanned
assuming that everything that might be a live heap pointer is indeed a live
heap pointer. When you build with "-enable-gc=true" it turns on machinery
in the compiler to enable precise stack scanning, meaning that the compiler
emits stack maps and then the runtime uses those maps to look at only life
heap pointers during scanning.

There are some other small differences between Gollvm and GC garbage
collection (notably the representation of the global roots list) but in
general they are using pretty much the same collector.

Thanks, Than



On Tue, Jul 9, 2019 at 8:13 AM eric fang <fangshuimin...@gmail.com> wrote:

> Hi Than, when I read the code, I found enable_gc_ is false by default, the
> description of option "-enable-gc=<value>" is "Enable stack map
> generation". I guess gollvm should have implemented garbage collection. My
> question are:
> 1,  what kind of gc does gollvm currently implement, and what is the
> difference between this gc and the one in main Go?
>
> 2, What effect does this option (-enable-gc) have on gollvm gc?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/186b9cda-eff5-4a09-b4eb-53350d76244c%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/186b9cda-eff5-4a09-b4eb-53350d76244c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55ENFVsr1QJ_wuqjaDcsgt0syamT%3Da3-nk-bNwyd1F1RFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to