X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Finterr.lisp;h=f5b46bcd08ac184c4a3a6c4eddf2057011adb72e;hb=68ea71d0f020f2726e3c56c1ec491d0af734b3a4;hp=5b97d54edb8a84718a915b21665f0d1441e284fc;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/src/code/interr.lisp b/src/code/interr.lisp index 5b97d54..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) @@ -392,8 +392,6 @@ ;;;; INTERNAL-ERROR signal handler -(defvar *internal-error-args*) - (defun internal-error (context continuable) (declare (type system-area-pointer context)) (declare (ignore continuable)) @@ -456,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)) @@ -463,4 +475,4 @@ (error 'undefined-alien-function-error)) (defun memory-fault-error () - (error 'memory-fault-error)) \ No newline at end of file + (error 'memory-fault-error))