chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
487aa28
)
Propper alignment of alien slots when subclassing
author
espen
<espen>
Sun, 19 Dec 2004 23:33:57 +0000
(23:33 +0000)
committer
espen
<espen>
Sun, 19 Dec 2004 23:33:57 +0000
(23:33 +0000)
glib/proxy.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/proxy.lisp
b/glib/proxy.lisp
index 72f201f288b222feb0749d7491a46a8fb25f4285..ef1a9b96e9b46e463876035fe48bd4869973425a 100644
(file)
--- a/
glib/proxy.lisp
+++ b/
glib/proxy.lisp
@@
-15,7
+15,7
@@
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: proxy.lisp,v 1.1
5 2004-12-16 23:19:1
7 espen Exp $
+;; $Id: proxy.lisp,v 1.1
6 2004-12-19 23:33:5
7 espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-246,6
+246,12
@@
(defgeneric instance-finalizer (object))
(defgeneric reference-foreign (class location))
(defgeneric unreference-foreign (class location))
(defgeneric reference-foreign (class location))
(defgeneric unreference-foreign (class location))
+(defmethod reference-foreign ((name symbol) location)
+ (reference-foreign (find-class name) location))
+
+(defmethod unreference-foreign ((name symbol) location)
+ (unreference-foreign (find-class name) location))
+
(defmethod unreference-foreign :around ((class class) location)
(unless (null-pointer-p location)
;; (format t "Unreferencing ~A at ~A" (class-name class) location)
(defmethod unreference-foreign :around ((class class) location)
(unless (null-pointer-p location)
;; (format t "Unreferencing ~A at ~A" (class-name class) location)
@@
-357,7
+363,11
@@
(defconstant +struct-alignmen+ 4)
(defmethod compute-slots ((class proxy-class))
(loop
(defmethod compute-slots ((class proxy-class))
(loop
- with offset = (proxy-instance-size (most-specific-proxy-superclass class))
+ with offset = (let ((size-of-super-classes
+ (proxy-instance-size
+ (most-specific-proxy-superclass class))))
+ (+ size-of-super-classes
+ (mod size-of-super-classes +struct-alignmen+)))
with size = offset
for slotd in (class-direct-slots class)
when (eq (slot-definition-allocation slotd) :alien)
with size = offset
for slotd in (class-direct-slots class)
when (eq (slot-definition-allocation slotd) :alien)