@@ -79,7 +79,12 @@ func (c *Config) GOARCH() string {
7979
8080// BuildTags returns the complete list of build tags used during this build.
8181func (c * Config ) BuildTags () []string {
82- tags := append (c .Target .BuildTags , []string {"tinygo" , "gc." + c .GC (), "scheduler." + c .Scheduler ()}... )
82+ gc := c .GC ()
83+ tags := append (c .Target .BuildTags , []string {"tinygo" , "gc." + gc , "scheduler." + c .Scheduler ()}... )
84+ switch gc {
85+ case "list" , "blocks" , "extalloc" :
86+ tags = append (tags , "gc.conservative" )
87+ }
8388 for i := 1 ; i <= c .GoMinorVersion ; i ++ {
8489 tags = append (tags , fmt .Sprintf ("go1.%d" , i ))
8590 }
@@ -96,7 +101,7 @@ func (c *Config) CgoEnabled() bool {
96101}
97102
98103// GC returns the garbage collection strategy in use on this platform. Valid
99- // values are "none", "leaking", "extalloc", and "conservative ".
104+ // values are "none", "leaking", "list", " extalloc", and "blocks ".
100105func (c * Config ) GC () string {
101106 if c .Options .GC != "" {
102107 return c .Options .GC
@@ -106,7 +111,7 @@ func (c *Config) GC() string {
106111 }
107112 for _ , tag := range c .Target .BuildTags {
108113 if tag == "baremetal" || tag == "wasm" {
109- return "conservative "
114+ return "blocks "
110115 }
111116 }
112117 return "extalloc"
@@ -116,7 +121,7 @@ func (c *Config) GC() string {
116121// that can be traced by the garbage collector.
117122func (c * Config ) NeedsStackObjects () bool {
118123 switch c .GC () {
119- case "conservative " , "extalloc" :
124+ case "list" , "blocks " , "extalloc" :
120125 for _ , tag := range c .BuildTags () {
121126 if tag == "baremetal" {
122127 return false
0 commit comments