On Mon, Dec 19, 2016 at 2:22 PM Jason E. Aten <j.e.a...@gmail.com> wrote:

> 1) there was always https://golang.org/pkg/reflect/#MakeFunc
>
>  2) and now with the 1.8 plugin support:
https://github.com/dragonfax/go_repl_plugin_example

None of the above generates a function (think machine code) at runtime. 1)
creates a new function value (a pointer to machine code in the first
approximation). Values are subject to garbage collection as usual. Note
that pointers to machine code are not interesting to the Go garbage
collector as the machine code is never collected (because it's never
created at runtime by Go runtime). If one would use some other mechanism
that really generates machine code at runtime, there are plenty of such,
then from the garbage collector POV they may be invisible in some mmaped
area or they may be, say a []byte, collected as usual when not reachable
anymore.

-- 

-j

-- 
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