branch: externals/pam
commit 0dcaa2cc9c36e0f5f6722cc0017cf0fced4d9c27
Author: Onnie Lynn Winebarger <owine...@gmail.com>
Commit: Onnie Lynn Winebarger <owine...@gmail.com>

    Provide two versions for tam-release, one with and one without finalization.
---
 tam.el | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/tam.el b/tam.el
index d554db215c..fd4637e852 100644
--- a/tam.el
+++ b/tam.el
@@ -431,17 +431,28 @@ Moves object to live list."
   (tam-claim/inline pool))
 
 (defsubst tam-release/inline (pool idx)
-  "Release object at index IDX of POOL."
+  "Release object at index IDX of POOL.
+User is responsible for any required finalization.
+Inline version"
+  (tam--free-slot pool (tam-pool-get pool idx))
+  nil)
+
+(defsubst tam-release-finalize/inline (pool idx)
+  "Release object at index IDX of POOL and invoke specified finalizer."
   (let ((s (tam-pool-get pool idx))
        (reset (tam--pool-reset pool)))
     (tam--free-slot pool s)
-    (when reset
-      (funcall reset (tam--slot-contents s)))
+    (funcall reset (tam--slot-contents s))
     nil))
 
 (defun tam-release (pool idx)
-  "Release object at index IDX of POOL."
+  "Release object at index IDX of POOL.
+User is responsible for any required finalization."
   (tam-release/inline pool idx))
 
+(defun tam-release-finalize (pool idx)
+  "Release object at index IDX of POOL and invoke specified finalizer."
+  (tam-release-finalize/inline pool idx))
+
 (provide 'tam)
 ;;; tam.el ends here

Reply via email to