File tree 1 file changed +16
-16
lines changed
1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -194,22 +194,22 @@ This avoids inadvertent calls to DecRef during recursions.")
194
194
; ; :do (let ((ptr (make-pointer addr)))
195
195
; ; (format t "~%At ~A with refcnt ~A:~% ~A"
196
196
; ; ptr count (lispify ptr))))
197
- (maphash ( lambda (addr count )
198
- ( declare ( type #+ 64-bit ( unsigned-byte 64 )
199
- #- 64-bit unsigned-byte
200
- addr )
201
- (type fixnum count ) )
202
- ( when ( and addr ( not ( zerop addr)))
203
- (with-python-gil/no-errors
204
- ( cond (( < count 0 )
205
- (foreign-funcall " Py_IncRef " :unsigned-long addr))
206
- ((> count 0 )
207
- (foreign-funcall " Py_DecRef " :unsigned-long addr))))))
208
- ht )
209
- ( maphash ( lambda (addr count )
210
- ( declare ( ignore count ))
211
- ( remhash addr ht ))
212
- ht ))
197
+ (with-python-gil/no-errors
198
+ ( with-hash-table-iterator (ht-iter ht )
199
+ ( loop :do ( multiple-value-bind (validp addr count ) (ht-iter)
200
+ ( unless validp ( return ) )
201
+ ( locally ( declare (type #+ 64-bit ( unsigned-byte 64 )
202
+ #- 64-bit unsigned-byte
203
+ addr)
204
+ ( type fixnum count ) )
205
+ ( when ( not ( zerop addr))
206
+ ( cond ((< count 0 )
207
+ (foreign-funcall " Py_IncRef "
208
+ :unsigned-long addr) )
209
+ (( > count 0 )
210
+ (foreign-funcall " Py_DecRef "
211
+ :unsigned-long addr)) ))
212
+ ( remhash addr ht))))) ))
213
213
(clear-lisp-objects))
214
214
nil )
215
215
You can’t perform that action at this time.
0 commit comments