Does that mean that only inlined functions will be optimized and any functions not inlined will not be optimized ?
在 2016年8月25日星期四 UTC+8上午11:55:12,Ian Lance Taylor写道: > > On Wed, Aug 24, 2016 at 7:06 PM, Cholerae Hu <chole...@gmail.com > <javascript:>> wrote: > > > > I've read the source of package runtime, and found that > runtime.KeepAlive is > > an empty function. If go compiler can do dead code elimination in the > > future, how to protect runtime.KeepAlive from being optimized? > > The KeepAlive function is marked with the magic go:noinline comment, > so it can't be inlined. > > In any case it seems possible that the compiler will recognize the > function specially in the future, for greater efficiency. > > 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. For more options, visit https://groups.google.com/d/optout.