-
Notifications
You must be signed in to change notification settings - Fork 4
/
bugfix.lisp
25 lines (21 loc) · 880 Bytes
/
bugfix.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(in-package :cl-user)
;; Workaround for a bug in SBCL 1.0.7.18 to 1.0.17.? where many nested
;; UNWIND-PROTECTs as produced by the macro CFFI:DEFCFUN result in
;; heap exhaustion.
;;
;; The version check needs to be in another file because the symbol in
;; question doesn't exist in SBCL before 1.0.7.18.
#|
#+(and sbcl sbcl-block-gensym-bug) ; feature added in features.lisp
(sb-ext:without-package-locks
(defun sb-impl::block-gensym (&optional (name "G")
(env (when (boundp 'sb-c::*lexenv*)
(symbol-value 'sb-c::*lexenv*))))
(let ((block-name
(when env
(car (find-if #'car (sb-c::lexenv-blocks env))))))
(if block-name
(gensym (format nil "~A[~A]" ; fix is here: was "~A[~S]"
name block-name))
(gensym name)))))
|#