|
Project Information
Featured
Downloads
Links
|
garbage-pools is Common Lisp re-implementation the APR Pools for resource management. APIpool with-garbage-pool ((&optional (var '*pool*)) &body body) (with-garbage-pool ()
(cleanup-register myobj clenup-fun))(with-garbage-pool (mypool)
(cleanup-register myobj clenup-fun mypool))cleanup-register (object cleanup-fun &optional (pool *pool*)) (with-garbage-pool () (cleanup-register (cffi:foreign-string-alloc "Hello world") #'cffi:foreign-string-free) ...) cleanup-pool (&optional (pool *pool*)) cleanup-object (object &optional (pool *pool*)) (with-garbage-pool ()
(let ((%str (cleanup-register (cffi:foreign-string-alloc "Hello world") #'cffi:foreign-string-free)))
(clenup-object %str)))cancel-object-cleanup (object &optional (pool *pool*)) (with-garbage-pool ()
(let ((%str (cleanup-register (cffi:foreign-string-alloc "Hello world") #'cffi:foreign-string-free)))
(cancel-object-clenup %str)))object-register (object &optional (pool *pool*)) (with-garbage-pool ()
(let ((stream (object-register (open #P"/tmp/data"))))
...)) defcleanup (class cleanup-fun) (defcleanup stream #'close) |