On Sat, Jan 11, 2020 at 4:43 AM <keith.rand...@gmail.com> wrote: >> But there's one guarantee - the "dead" slice portion after >> cap will not be scanned by the collector if no other live object uses >> it. > > > That's not correct. If there is a reference to an object, the entire object > is live and is scanned, regardless of what the reference(s) looks like (ptr, > slice with small cap, slice with large cap). > Again, this isn't in the spec - in principle the GC could not scan past the > largest capacity. But we don't currently do that.
Might be a low hanging optimization opportunity. But proving no other references exist is possibly the blocking issue. -- 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/CAA40n-WXF0ToQV8Uv4JzXatgeXapo%2BpDyf-ik2j_yS40j6tytg%40mail.gmail.com.