Changeset 184


Ignore:
Timestamp:
Jan 3, 2004, 11:45:59 AM (21 years ago)
Author:
Gary Byers
Message:

More gnu-objc conditionalization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/objc-support.lisp

    r139 r184  
    66  (require "BRIDGE"))
    77
     8#+apple-objc
     9(progn
    810;;; NSException-handling stuff.
    911;;; First, we have to jump through some hoops so that #_longjmp can
     
    6365  t)
    6466
    65 
     67)
    6668
    6769(defvar *condition-id-map* (make-id-map) "Map lisp conditions to small integers")
     
    106108                      :with-lisp-id (assign-id-map-id *condition-id-map* c)))
    107109
     110#+apple-objc
     111(progn
    108112;;; (#__NSRaiseError nsexception) is entirely equivalent to
    109113;;; -[NSException raise].  If we get nervous about passing the former
     
    119123  nil)
    120124
    121  
     125)
    122126
    123127(defun open-main-bundle ()
     
    144148                (send keys :add-object nextkey)
    145149                (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)
    147151              (send keys :add-object nextkey)
    148152              (send values :add-object newval)
     
    151155                        :with-objects values
    152156                        :for-keys keys)))
    153 
    154157
    155158
     
    185188         (setq *listener-autorelease-pool* (create-autorelease-pool)))))))
    186189
     190#+apple-objc
    187191(defun show-autorelease-pools ()
    188192  (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))))
    189204
    190205(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.