[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pam 7b072b5457 07/16: Added API documentation to header
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pam 7b072b5457 07/16: Added API documentation to header. |
Date: |
Wed, 20 Sep 2023 12:59:10 -0400 (EDT) |
branch: externals/pam
commit 7b072b5457a8aa3b99ec4e45535d6f7d67ff280c
Author: Onnie Lynn Winebarger <owinebar@gmail.com>
Commit: Onnie Lynn Winebarger <owinebar@gmail.com>
Added API documentation to header.
---
table-allocation-manager.el | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/table-allocation-manager.el b/table-allocation-manager.el
index 8683400edb..1f0bd795f1 100644
--- a/table-allocation-manager.el
+++ b/table-allocation-manager.el
@@ -24,6 +24,25 @@
;; table. All allocation is done during initialization to avoid triggering
;; garbage collection during allocation/free operations.
+;; API:
+;;
+;; (tam-create-table N) => table of size N
+;; (tam-table-fullp TABLE) => nil unless TABLE is full
+;; (tam-table-emptyp TABLE) => nil unless TABLE is empty
+;; (tam-table-size TABLE) => number of slots in TABLE
+;; (tam-table-used TABLE) => number of slots of TABLE in use
+;; (tam-table-get TABLE IDX) => contents of TABLE slot at index IDX
+;; (tam-table-allocate TABLE OBJ) =>
+;; if not full, assigns OBJ to contents of a free slot in TABLE,
+;; and returns the index of the slot
+;; if full, returns nil
+;; (tam-table-free TABLE INDEX) =>
+;; if slot at INDEX of TABLE is in use, move to the free list and
+;; return the object formerly held by the slot
+;; if slot is already free, signal an error
+;; (tam-table-free-list TABLE) => list of free indices in TABLE
+;; (tam-table-live-list TABLE) => list of in-use indices in TABLE
+
;;; Code:
@@ -81,18 +100,25 @@
-(defun tam-table-full (tbl)
+(defun tam-table-fullp (tbl)
"Test if TBL is full."
(<= (tam--table-size tbl) (tam--table-used tbl)))
-(defun tam-table-empty (tbl)
- "Test if TBL is full."
+(defun tam-table-emptyp (tbl)
+ "Test if TBL is empty."
(= (tam--table-used tbl) 0))
+(defalias tam-table-size tam--table-size
+ "Number of table slots.")
+
+(defalias tam-table-used tam--table-size
+ "Number of slots of table in use.")
+
(defun tam--table-get-slot (tbl idx)
"Get slot IDX of TBL"
(aref (tam--table-slots tbl) idx))
+
(defun tam-table-get (tbl idx)
"Get slot IDX of TBL"
(tam--slot-contents (aref (tam--table-slots tbl) idx)))
@@ -102,9 +128,9 @@
Returns index or nil if table is full."
(let ((s (tam--table-first-free tbl))
next idx)
- (when (not (tam-table-full tbl))
+ (when (not (tam-table-fullp tbl))
(setf (tam--slot-previous s) (tam--table-last-used tbl))
- (if (tam-table-empty tbl)
+ (if (tam-table-emptyp tbl)
(setf (tam--table-first-used tbl) s)
(setf (tam--slot-next (tam--table-last-used tbl)) s))
(setf (tam--table-last-used tbl) s)
@@ -116,7 +142,7 @@ Returns index or nil if table is full."
(cl-incf (tam--table-used tbl))
(when next
(setf (tam--slot-previous next) nil))
- (when (tam-table-full tbl)
+ (when (tam-table-fullp tbl)
(setf (tam--table-last-free tbl) nil))
(setq idx (tam--slot-index s)))
idx))
- [elpa] branch externals/pam created (now 0dcaa2cc9c), ELPA Syncer, 2023/09/20
- [elpa] externals/pam 40b679999a 01/16: Initial commit, ELPA Syncer, 2023/09/20
- [elpa] externals/pam 2804ad6832 04/16: First successfully byte-compiled version, ELPA Syncer, 2023/09/20
- [elpa] externals/pam adcdd8d6aa 03/16: Ignore byte-compiled files and others, ELPA Syncer, 2023/09/20
- [elpa] externals/pam 1eb72029e8 02/16: Update README.md, ELPA Syncer, 2023/09/20
- [elpa] externals/pam d2dd6a9796 05/16: Add functions to report free and live index lists, ELPA Syncer, 2023/09/20
- [elpa] externals/pam 7b072b5457 07/16: Added API documentation to header.,
ELPA Syncer <=
- [elpa] externals/pam 21cf632947 13/16: Added documentation strings to struct fields, ELPA Syncer, 2023/09/20
- [elpa] externals/pam bc654b6d68 14/16: Change data structures to primitive representation., ELPA Syncer, 2023/09/20
- [elpa] externals/pam 0dcaa2cc9c 16/16: Provide two versions for tam-release, one with and one without finalization., ELPA Syncer, 2023/09/20
- [elpa] externals/pam fe28ad02db 06/16: Fixed tam-allocate and tam-free functions., ELPA Syncer, 2023/09/20
- [elpa] externals/pam c74c0e06b5 12/16: Improve tam-create-pool docstring, ELPA Syncer, 2023/09/20
- [elpa] externals/pam acb2a6cbbb 11/16: Add object pool management, ELPA Syncer, 2023/09/20
- [elpa] externals/pam cbc1727fea 08/16: Fixed some issues with tam-table-used and tam-table-size., ELPA Syncer, 2023/09/20
- [elpa] externals/pam 15106c6acd 15/16: Define tam-already-free error symbol, ELPA Syncer, 2023/09/20
- [elpa] externals/pam 0f1f5cf265 10/16: Use cl-loop instead of queue package, ELPA Syncer, 2023/09/20
- [elpa] externals/pam c254ec9f64 09/16: Renamed library and updated headers, ELPA Syncer, 2023/09/20