Liking cljdoc? Tell your friends :D

tech.resource.gc

System for using both weak and soft references generically. Weak references don't count for anything in the gc while soft references will keep their object alive as long as there is no gc pressure.

System for using both weak and soft references generically.  Weak references don't
count for anything in the gc while soft references will keep their object alive as
long as there is no gc pressure.
raw docstring

*reference-queue*clj

source

*reference-thread*clj

source

*weak-reference-set*clj

source

gc-referenceclj

(gc-reference item dispose-fn & {:keys [track-reference?]})

Create a weak reference to the item. Return the actual reference. You can get the item (assuming it hasn't been cleaned up) using .get method on the reference. Note that dispose-fn must not reference item in any way else the item won't get cleaned up.

IF track-reference is true, then the reference itself is added to the reference set. This keeps the reference itself from being gc'd. This is not necessary if you know the reference will outlive the tracked object (or if you don't care).

Create a weak reference to the item.  Return the actual reference.  You can get the
item (assuming it hasn't been cleaned up) using .get method on the reference.  Note
that dispose-fn must *not* reference item in any way else the item won't get cleaned
up.

IF track-reference is *true*, then the reference itself is added to the reference set.
This keeps the reference itself from being gc'd.  This is not necessary if you know
the reference will outlive the tracked object (or if you don't care).
sourceraw docstring

soft-referenceclj

(soft-reference item dispose-fn & {:keys [track-reference?]})

Create a soft reference to the item. Return the actual reference. You can get the item (assuming it hasn't been cleaned up) using .get method on the reference. Note that dispose-fn must not reference item in any way else the item won't get cleaned up.

If track-reference is true, then the reference itself is added to the reference set. This keeps the reference itself from being gc'd. This is not necessary if you know the reference will outlive the tracked object (or if you don't care).

Create a soft reference to the item.  Return the actual reference.  You can get the
item (assuming it hasn't been cleaned up) using .get method on the reference.  Note
that dispose-fn must *not* reference item in any way else the item won't get cleaned
up.

If track-reference is *true*, then the reference itself is added to the reference set.
This keeps the reference itself from being gc'd.  This is not necessary if you know
the reference will outlive the tracked object (or if you don't care).
sourceraw docstring

start-reference-threadclj

(start-reference-thread)
source

stop-reference-threadclj

(stop-reference-thread)
source

trackclj

(track item dispose-fn)

Track an item via both the gc system and the stack based system. Dispose will be first-one-wins. Dispose-fn must not referent item else the circular dependency will stop the dispose-fn from being called.

Track an item via both the gc system *and* the stack based system.  Dispose will be
first-one-wins.  Dispose-fn must not referent item else the circular dependency will
stop the dispose-fn from being called.
sourceraw docstring

track-gc-onlyclj

(track-gc-only item dispose-fn)

Track this item using weak references. Note that the dispose-fn must absolutely not reference the item else nothing will ever get released.

Track this item using weak references.  Note that the dispose-fn must absolutely
*not* reference the item else nothing will ever get released.
sourceraw docstring

watch-reference-queueclj

(watch-reference-queue run-atom reference-queue)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close