diff options
Diffstat (limited to 'compileopts/config.go')
-rw-r--r-- | compileopts/config.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compileopts/config.go b/compileopts/config.go index 240f14c97..197253e42 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -77,6 +77,21 @@ func (c *Config) GC() string { return "conservative" } +// NeedsStackObjects returns true if the compiler should insert stack objects +// that can be traced by the garbage collector. +func (c *Config) NeedsStackObjects() bool { + if c.GC() != "conservative" { + return false + } + for _, tag := range c.BuildTags() { + if tag == "baremetal" { + return false + } + } + + return true +} + // Scheduler returns the scheduler implementation. Valid values are "coroutines" // and "tasks". func (c *Config) Scheduler() string { |