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:
8958fa4
)
Added more debugging stuff
author
espen
<espen>
Mon, 6 Feb 2006 11:34:05 +0000
(11:34 +0000)
committer
espen
<espen>
Mon, 6 Feb 2006 11:34:05 +0000
(11:34 +0000)
glib/gobject.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/gobject.lisp
b/glib/gobject.lisp
index 40ef3ea81940f3ae703a773cd235f9f4f809f15a..2a91c0cf2c45195d9ff538229da76506bc00d855 100644
(file)
--- a/
glib/gobject.lisp
+++ b/
glib/gobject.lisp
@@
-20,7
+20,7
@@
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-;; $Id: gobject.lisp,v 1.4
3 2006-02-05 15:38:57
espen Exp $
+;; $Id: gobject.lisp,v 1.4
4 2006-02-06 11:34:05
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-28,6
+28,7
@@
(in-package "GLIB")
;;;; Metaclass used for subclasses of gobject
(eval-when (:compile-toplevel :load-toplevel :execute)
;;;; Metaclass used for subclasses of gobject
(eval-when (:compile-toplevel :load-toplevel :execute)
+;; (push :debug-ref-counting *features*)
(defclass gobject-class (ginstance-class)
((instance-slots-p :initform nil
:documentation "Non NIL if the class has slots with instance allocation")))
(defclass gobject-class (ginstance-class)
((instance-slots-p :initform nil
:documentation "Non NIL if the class has slots with instance allocation")))
@@
-203,10
+204,18
@@
(defmethod shared-initialize :after ((class gobject-class) names &rest initargs)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass gobject (ginstance)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defclass gobject (ginstance)
- ()
+ (#+debug-ref-counting
+ (ref-count :allocation :alien :type int :reader ref-count))
(:metaclass gobject-class)
(:gtype "GObject")))
(:metaclass gobject-class)
(:gtype "GObject")))
+#+debug-ref-counting
+(defmethod print-object ((instance gobject) stream)
+ (print-unreadable-object (instance stream :type t :identity nil)
+ (if (slot-boundp instance 'location)
+ (format stream "at 0x~X (~D)" (sap-int (foreign-location instance)) (ref-count instance))
+ (write-string "at \"unbound\"" stream))))
+
(defun initial-add (object function initargs key pkey)
(loop
(defun initial-add (object function initargs key pkey)
(loop