Liking cljdoc? Tell your friends :D

tech.v3.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

gc-referenceclj

(gc-reference item dispose-fn)

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

Note - Under situation of high garbage collector activity the caller must hold a reference to item else it could get disposed of during this function call.

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

**Note** - Under situation of high garbage collector activity the caller *must* hold
a reference to item else it could get disposed of *during* this function call.
sourceraw docstring

reference-queueclj

source

reference-threadclj

source

reference-thread*clj

source

soft-referenceclj

(soft-reference item dispose-fn)

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

Note - Under situation of high garbage collector activity the caller must hold a reference to item else it could get disposed of during this function call.

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

  **Note** - Under situation of high garbage collector activity the caller *must* hold
a reference to item else it could get disposed of *during* this function call.
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 reference 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 reference 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

weak-reference-setclj

source

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

× close