Aha, I forgot this fact. You are totally right. It is a bad example. A better example: is it possible to detect that some values are always single-owner (and their out-of-reach time point are also detectable)?
On Sunday, November 15, 2020 at 8:23:58 PM UTC-5 [email protected] wrote: > I may be misunderstanding what you're suggesting, but I believe Go already > tries to detect when a value can be placed on the stack. Then, it will be > freed automatically when it falls out of scope. > > On Sun, Nov 15, 2020 at 5:20 PM [email protected] <[email protected]> > wrote: > >> >> For example, some local memory allocations could be detected no used >> elsewhere so that they can may be freed immediately when out of reach >> instead of waiting to be freed in the GC phase. >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/5c38b239-fe56-44ce-aaf6-61636a682707n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/5c38b239-fe56-44ce-aaf6-61636a682707n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/7c7fcfde-14a3-4c6d-b53c-3c44f31d1568n%40googlegroups.com.
