Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lyskom-elisp-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lyskom-elisp-client
lyskom-elisp-client
Commits
2ce3362a
Commit
2ce3362a
authored
Aug 12, 1996
by
David Kågedal
Browse files
Options
Downloads
Patches
Plain Diff
Ny lågnivåimplementering, men den är utkommenterad tills vidare.
parent
bcecf244
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cache.el
+66
-0
66 additions, 0 deletions
src/cache.el
with
66 additions
and
0 deletions
src/cache.el
+
66
−
0
View file @
2ce3362a
...
@@ -406,6 +406,72 @@ CACHE is the name of the variable that points to the cache."
...
@@ -406,6 +406,72 @@ CACHE is the name of the variable that points to the cache."
(
set
cache
nil
)
(
set
cache
nil
)
(
setq
lyskom-caches
(
delete
cache
lyskom-caches
)))
(
setq
lyskom-caches
(
delete
cache
lyskom-caches
)))
;; (defsubst cache-hash (key cache)
;; "Return a hash value for use in the cache."
;; (mod key (length (aref cache 2))))
;;
;; (defun cache-create (cache &optional size)
;; (set cache (vector 'CACHE-HASH (or size 1000)
;; (make-vector (or size 1000) nil)))
;; (if (not (memq cache lyskom-caches))
;; (setq lyskom-caches (cons cache lyskom-caches)))
;; (symbol-value cache))
;;
;; (defun cache-rehash (cache-symbol)
;; (let* ((cache (symbol-value cache-symbol))
;; (newsize (/ (aref cache 1) 5))
;; (oldsize (length (aref cache 2)))
;; (i 0))
;; (cache-create cache-symbol newsize)
;; (while (< i oldsize)
;; (let ((entries (aref cache i)))
;; (while entries
;; (cache-add cache-symbol (car (car entries)) (cdr (car entries)))
;; (setq entries (cdr entries))))
;; (setq i (1+ i)))
;; (symbol-value cache-symbol)))
;;
;; (defun cache-assoc (key cache)
;; "Get data for item with key KEY from CACHE.
;; CACHE is an assoc-list in this implementation."
;; (if cache
;; (cdr-safe (assq key (aref (aref cache 2)
;; (cache-hash key cache))))))
;;
;;
;;
;; (defun cache-add (key data cache-symbol)
;; "Add DATA to CACHE under the key KEY.
;; Args: KEY DATA CACHE.
;; CACHE is a (the only one) quoted variable pointing to the cache (an alist).
;; The variable might be changed."
;; (let ((cache (symbol-value cache-symbol)))
;; (if (null cache)
;; (setq cache (cache-create cache-symbol))
;; (if (> (aset cache 1 (1+ (aref cache 1)))
;; (* (length (aref cache 2)) 20))
;; (setq cache (cache-rehash cache-symbol))))
;; (let ((hash (cache-hash key cache)))
;; (aset (aref cache 2) hash
;; (cons (cons key data) (aref (aref cache 2) hash))))))
;;
;; (defun cache-del (key cache-symbol)
;; "Delete item with key KEY from CACHE.
;; CACHE is the name of the variable that points to the cache."
;; (let ((cache (symbol-value cache-symbol)))
;; (if cache
;; (let* ((hash (cache-hash key cache))
;; (entries (aref (aref cache 2) hash))
;; (ass (assq key entries)))
;; (if ass
;; (progn (aset cache 1 (1- (aref cache 1)))
;; (aset (aref cache 2) hash
;; (delq ass entries))))))))
;;
;; (defun cache-clear (cache)
;; (set cache nil)
;; (setq lyskom-caches (delete cache lyskom-caches)))
(
defun
clear-all-caches
()
(
defun
clear-all-caches
()
(
mapcar
(
function
(
lambda
(
cache
)
(
set
cache
nil
)))
(
mapcar
(
function
(
lambda
(
cache
)
(
set
cache
nil
)))
lyskom-caches
)
lyskom-caches
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment