On Fri, Jul 19, 2019 at 5:17 PM Andrey Tcherepanov <xnow4fippy...@sneakemail.com> wrote: > > I understand that it is very easy on application level... if programmer even > thought about it. But my assumption is that compiler has some sort of > liveness analysis, and it could be utilized here just to help with disposal > of a bitten part.
The kind of liveness analysis done by the compiler is only helpful in extremely limited circumstances: when the compiler can track the slice from creation to destruction and when the slice never escapes in any way. I'm skeptical that such a case happens often enough to be worth implementing. (And even if we did implement it we would still have the above-mentioned problem that the allocator doesn't support discarding part of an allocation.) Ian -- 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/CAOyqgcVw1CHe8LV_grVycMfxz2cp7273KcQU7GASvXCZ29-3pQ%40mail.gmail.com.