X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Finterr.lisp;h=f5b46bcd08ac184c4a3a6c4eddf2057011adb72e;hb=832f3b5652ae1b4a8888829cd4a1b391a8ca9952;hp=0069e54cd6acb4bebe247b67d2fe9ddd0bd66fe8;hpb=0e7386b1532a9f2a913597bb7544428b29c62a73;p=sbcl.git diff --git a/src/code/interr.lisp b/src/code/interr.lisp index 0069e54..f5b46bc 100644 --- a/src/code/interr.lisp +++ b/src/code/interr.lisp @@ -238,7 +238,7 @@ :operands (list this that))) (deferr object-not-type-error (object type) - (error (if (and (typep object 'instance) + (error (if (and (%instancep object) (layout-invalid (%instance-layout object))) 'layout-invalid 'type-error) @@ -454,6 +454,20 @@ "Control stack guard page temporarily disabled: proceed with caution~%") (error 'control-stack-exhausted)))) +;;; KLUDGE: we keep a single HEAP-EXHAUSTED-ERROR object around, so +;;; that we don't need to allocate it when running out of memory. Similarly +;;; we pass the amounts in special variables as there may be multiple threads +;;; running into trouble at the same time. The condition is created by GC-REINIT. +(defvar *heap-exhausted-error-condition*) +(defvar *heap-exhausted-error-available-bytes*) +(defvar *heap-exhausted-error-requested-bytes*) + +(defun heap-exhausted-error (available requested) + (infinite-error-protect + (let ((*heap-exhausted-error-available-bytes* available) + (*heap-exhausted-error-requested-bytes* requested)) + (error *heap-exhausted-error-condition*)))) + (defun undefined-alien-variable-error () (error 'undefined-alien-variable-error))