Changeset 6049


Ignore:
Timestamp:
Mar 17, 2007, 6:42:33 AM (13 years ago)
Author:
gb
Message:

FREE: be careful about gcable pointers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/objc-gf/ccl/level-0/l0-io.lisp

    r5982 r6049  
    110110
    111111(defun free (ptr)
    112   (ff-call
    113    (%kernel-import target::kernel-import-free)
    114    :address ptr :void))
     112  (let* ((size (uvsize ptr))
     113         (flags (if (= size target::xmacptr.size)
     114                  (uvref ptr target::xmacptr.flags-cell)
     115                  $flags_DisposPtr)))
     116    (declare (fixnum size flags))
     117    (if (= flags $flags_DisposPtr)
     118      (with-macptrs ((addr ptr))
     119        (when (= size target::xmacptr.size)
     120          (%setf-macptr ptr (%null-ptr))
     121          (setf (uvref ptr target::xmacptr.flags-cell) $flags_Normal))
     122        (ff-call
     123         (%kernel-import target::kernel-import-free)
     124         :address addr :void)))))
    115125
    116126
    117 ;;; Yield the CPU, via a platform-specific syscall.
    118127
    119128
Note: See TracChangeset for help on using the changeset viewer.