This is the trivial-garbage Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:56:03 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
trivial-garbage
Portable finalizers, weak hash-tables and weak pointers.
Luis Oliveira <loliveira@common-lisp.net>
Public Domain
trivial-garbage.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
trivial-garbage/trivial-garbage.asd
trivial-garbage
(system).
trivial-garbage/trivial-garbage.lisp
trivial-garbage
(system).
cancel-finalization
(function).
finalize
(function).
gc
(function).
hash-table-weakness
(function).
make-weak-hash-table
(function).
make-weak-pointer
(function).
weak-pointer-p
(function).
weak-pointer-value
(function).
*weakness-warnings*
(special variable).
make-hash-table
(function).
weakness-keyword-arg
(function).
weakness-keyword-opt
(function).
weakness-missing
(function).
Packages are listed by definition order.
trivial-garbage
@a[http://common-lisp.net/project/trivial-garbage]{trivial-garbage}
provides a portable API to finalizers, weak hash-tables and weak
pointers on all major implementations of the Common Lisp
programming language. For a good introduction to these
data-structures, have a look at
@a[http://www.haible.de/bruno/papers/cs/weak/WeakDatastructures-writeup.html]{Weak
References: Data Types and Implementation} by Bruno Haible.
Source code is available at
@a[https://github.com/trivial-garbage/trivial-garbage]{github},
which you are welcome to use for submitting patches and/or
@a[https://github.com/trivial-garbage/trivial-garbage/issues]{bug
reports}. Discussion takes place on
@a[http://lists.common-lisp.net/cgi-bin/mailman/listinfo/trivial-garbage-devel]{trivial-garbage-devel
at common-lisp.net}.
@a[http://common-lisp.net/project/trivial-garbage/releases/]{Tarball
releases} are available, but the easiest way to install this
library is via @a[http://www.quicklisp.org/]{Quicklisp}:
@code{(ql:quickload :trivial-garbage)}.
@begin[Weak Pointers]{section}
A @em{weak pointer} holds an object in a way that does not prevent
it from being reclaimed by the garbage collector. An object
referenced only by weak pointers is considered unreachable (or
"weakly reachable") and so may be collected at any time. When
that happens, the weak pointer’s value becomes @code{nil}.
@aboutfun{make-weak-pointer}
@aboutfun{weak-pointer-value}
@aboutfun{weak-pointer-p}
@end{section}
@begin[Weak Hash-Tables]{section}
A @em{weak hash-table} is one that weakly references its keys
and/or values. When both key and value are unreachable (or weakly
reachable) that pair is reclaimed by the garbage collector.
@aboutfun{make-weak-hash-table}
@aboutfun{hash-table-weakness}
@end{section}
@begin[Finalizers]{section}
A @em{finalizer} is a hook that is executed after a given object
has been reclaimed by the garbage collector.
@aboutfun{finalize}
@aboutfun{cancel-finalization}
@end{section}
tg
common-lisp
.
cancel-finalization
(function).
finalize
(function).
gc
(function).
hash-table-weakness
(function).
make-weak-hash-table
(function).
make-weak-pointer
(function).
weak-pointer-p
(function).
weak-pointer-value
(function).
*weakness-warnings*
(special variable).
make-hash-table
(function).
weakness-keyword-arg
(function).
weakness-keyword-opt
(function).
weakness-missing
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Cancels all of @code{object}’s finalizers, if any.
Pushes a new @code{function} to the @code{object}’s list of
finalizers. @code{function} should take no arguments. Returns
@code{object}.
@b{Note:} @code{function} should not attempt to look at @code{object} by closing over it because that will prevent it from being garbage collected.
Initiates a garbage collection. @code{full} forces the collection of all generations, when applicable. When @code{verbose} is @em{true}, diagnostic information about the collection is printed if possible.
Returns one of @code{nil}, @code{:key}, @code{:value}, @code{:key-or-value} or @code{:key-and-value}.
Returns a new weak hash table. In addition to the standard
arguments accepted by @code{cl:make-hash-table}, this function adds
extra keywords: @code{:weakness} being the kind of weak table it
should create, and @code{:weakness-matters} being whether an error
should be signalled when that weakness isn’t available (the default
is to signal an error). @code{weakness} can be one of @code{:key},
@code{:value}, @code{:key-or-value}, @code{:key-and-value}.
If @code{weakness} is @code{:key} or @code{:value}, an entry is
kept as long as its key or value is reachable, respectively. If
@code{weakness} is @code{:key-or-value} or @code{:key-and-value},
an entry is kept if either or both of its key and value are
reachable, respectively.
@code{tg::make-hash-table} is available as an alias for this function should you wish to import it into your package and shadow @code{cl:make-hash-table}.
Creates a new weak pointer which points to @code{object}. For portability reasons, @code{object} must not be @code{nil}.
Returns @em{true} if @code{object} is a weak pointer and @code{nil} otherwise.
If @code{weak-pointer} is valid, returns its value. Otherwise, returns @code{nil}.
List of weaknesses that have already been warned about this session. Used by ‘weakness-missing’.
Signal an error or warning, depending on ERRORP, about lack of Lisp support for WEAKNESS.
Jump to: | C F G H M W |
---|
Jump to: | C F G H M W |
---|
Jump to: | *
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
* | |||
*weakness-warnings* : | Private special variables | ||
| |||
S | |||
Special Variable, *weakness-warnings* : | Private special variables | ||
|
Jump to: | *
S |
---|
Jump to: | F P S T |
---|
Jump to: | F P S T |
---|