Changeset 184
- Timestamp:
- Jan 3, 2004, 11:45:59 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/examples/objc-support.lisp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/examples/objc-support.lisp
r139 r184 6 6 (require "BRIDGE")) 7 7 8 #+apple-objc 9 (progn 8 10 ;;; NSException-handling stuff. 9 11 ;;; First, we have to jump through some hoops so that #_longjmp can … … 63 65 t) 64 66 65 67 ) 66 68 67 69 (defvar *condition-id-map* (make-id-map) "Map lisp conditions to small integers") … … 106 108 :with-lisp-id (assign-id-map-id *condition-id-map* c))) 107 109 110 #+apple-objc 111 (progn 108 112 ;;; (#__NSRaiseError nsexception) is entirely equivalent to 109 113 ;;; -[NSException raise]. If we get nervous about passing the former … … 119 123 nil) 120 124 121 125 ) 122 126 123 127 (defun open-main-bundle () … … 144 148 (send keys :add-object nextkey) 145 149 (send values :add-object (send src :object-for-key nextkey))) 146 (when (send nextkey :is-equal-to newkey)150 (when (send nextkey :is-equal-to-string newkey) 147 151 (send keys :add-object nextkey) 148 152 (send values :add-object newval) … … 151 155 :with-objects values 152 156 :for-keys keys))) 153 154 157 155 158 … … 185 188 (setq *listener-autorelease-pool* (create-autorelease-pool))))))) 186 189 190 #+apple-objc 187 191 (defun show-autorelease-pools () 188 192 (send (@class ns-autorelease-pool) 'show-pools)) 193 194 #+gnu-objc 195 (defun show-autorelease-pools () 196 (do* ((current (objc-message-send (@class ns-autorelease-pool) "currentPool") 197 (objc-message-send current "_parentAutoreleasePool")) 198 (i 0 (1+ i))) 199 ((%null-ptr-p current) (values)) 200 (format t "~& ~d : ~a [~d]" 201 i 202 (nsobject-description current) 203 (pref current :<NSA>utorelease<P>ool._released_count)))) 189 204 190 205 (define-toplevel-command :global sap () "Log information about current thread's autorelease-pool(s) to C's standard error stream"
Note:
See TracChangeset
for help on using the changeset viewer.
