Clojurians
#hoplon
<
2015-07-31
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

ul05:07:29

ha-ha, all nicknames are familiar 😃

ul05:07:46

salute!

ul16:07:05

@micha what is the full story with javelin cells GCing? Are they GCed only when explicitly disposed?

alandipert16:07:49

@ul: that's right

ul16:07:39

i think about applying javelin in the situation when i need to create and destroy cells dynamically

ul16:07:51

may be even lot of them

ul16:07:19

so need to think about proper dispose

alandipert16:07:57

Maybe the right answer, but not very portable, is for javelin to use weakmap to store sources and sinks

ul17:07:54

I'm not sure if Clojure version is ready for use atm nevertheless

ul17:07:12

iirc it is not ready for multithreaded use

ul17:07:18

but may be i'm wrong

micha17:07:31

yeah this is a good thing to think about

micha17:07:12

it's possible now to use the destroy-cell! function to unlink a cell so it can be GC

micha17:07:46

and you can walk .-sinks too if necessary

micha17:07:58

and destroy those

micha17:07:22

the destroy function unlinks the cell from the dependency graph and also removes watches

micha17:07:25

i think one problem with the weakmap is that it would cause things to be eligible for GC when you still need them

micha17:07:35

like suppose i have the following:

micha17:07:23

(defc c [])

(defn f []
  (cell= (pr :inc-c (map inc c))))

(f)

micha17:07:41

if .-sources and .-sinks were weak maps the anonymous cell created by f would be immediately eligible for GC, no?