It is placed in the public domain with absolutely no warranty.
A darcs tree is available:
darcs get http://common-lisp.net/~loliveira/darcs/trivial-garbage/
Comments, suggestions and patches are welcome and can be sent to loliveira at common-lisp dot net
Â Function: tg:cancel-finalization object
Cancels all of OBJECT's finalizers, if any.
Â Function: tg:finalize object function
Pushes a new FUNCTION to the OBJECT's list of finalizers. FUNCTION should take no arguments. Returns OBJECT.
For portability reasons, FUNCTION should not attempt to look at OBJECT by closing over it because, in some lisps, OBJECT will already have been garbage collected and is therefore not accessible when FUNCTION is invoked.
Â Function: tg:gc &key full verbose
Initiates a garbage collection.
Â Function: tg:hash-table-weakness ht
Returns one of NIL, :KEY, :VALUE, :KEY-OR-VALUE or :KEY-AND-VALUE.
Â Function: tg:make-weak-hash-table &rest args &key weakness (weakness-matters t) &allow-other-keys
Returns a new weak hash table. In addition to the standard arguments accepted by CL:MAKE-HASH-TABLE, this function adds extra keywords: :WEAKNESS being the kind of weak table it should create, and :WEAKNESS-MATTERS being whether an error should be signalled when that weakness isn't available (the default is to signal an error). WEAKNESS can be one of :KEY, :VALUE, :KEY-OR-VALUE, :KEY-AND-VALUE.
TG::MAKE-HASH-TABLE is available as an alias for this function should you wish to import it into your package and shadow CL:MAKE-HASH-TABLE.
Â Function: tg:make-weak-pointer object
Creates a new weak pointer which points to OBJECT. For portability reasons, OBJECT most not be NIL.
Â Function: tg:weak-pointer-p object
Returns true if OBJECT is a weak pointer and NIL otherwise.
Â Function: tg:weak-pointer-value weak-pointer
If WEAK-POINTER is valid, returns its value. Otherwise, returns NIL.