Fork me on GitHub
#clojure-dev
<
2019-12-11
>
pyr19:12:44

I was reading clojure.lang.MultiFn and noticed the use of Util#ret1 (e.g here: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/MultiFn.java#L242-L248)

👍 1
pyr19:12:02

is the intent to play with the GC?

hiredman19:12:32

it is replicating locals clearing

pyr19:12:11

ah, gotcha, thanks

hiredman19:12:27

the clojure compiler will generate jvm bytecode that loads a local on to the stack, then nulls out the local, then does whatever with the value on the stack, which means the local isn't keeping a reference around anymore, but you cannot directly replicate that bytecode as java source code

👍 3