Commit 970eef3a authored by csr21's avatar csr21
Browse files

cache only one's own resource IDs

Should fix the problem described by Shawn Betts on sbcl-devel
2008-07-11 (and possibly also the one on portable-clx 2008-07-10).
Analysis on clisp-devel around the same dates, too.

parent ab2f9a78
......@@ -192,9 +192,9 @@
`(funcall (display-xid ,display) ,display))))
(defmacro deallocate-resource-id (display id type)
(declare (ignore type))
;; Deallocate a resource-id for OBJECT in DISPLAY
(when (member (eval type) +clx-cached-types+)
`(deallocate-resource-id-internal ,display ,id)))
`(deallocate-resource-id-internal ,display ,id))
(defun deallocate-resource-id-internal (display id)
(with-display (display)
......@@ -205,12 +205,17 @@
(gethash id (display-resource-id-map display)))
(defun save-id (display id object)
;; Register a resource-id from another display.
;; cache the object associated with ID for this display.
(declare (type display display)
(type integer id)
(type t object))
(declare (clx-values object))
(setf (gethash id (display-resource-id-map display)) object))
;; we can't cache objects from other clients, because they may
;; become invalid without us being told about that.
(let ((base (display-resource-id-base display))
(mask (display-resource-id-mask display)))
(when (= (logandc2 id mask) base)
(setf (gethash id (display-resource-id-map display)) object))))
;; Define functions to find the CLX data types given a display and resource-id
;; If the data type is being cached, look there first.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment