On Wed, Aug 24, 2016 at 7:06 PM, Cholerae Hu <cholerae...@gmail.com> 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.

Reply via email to