Ignore:
Timestamp:
May 23, 2011, 12:25:45 PM (8 years ago)
Author:
gb
Message:

Define and export the functions ALLOW-HEAP-ALLOCATION and
HEAP-ALLOCATION-ALLOWED-P and the condition type ALLOCATION-DISABLED.

(ALLOW-HEAP-ALLOCATION arg) : when ARG is NIL, causes any subsequent
attempts to heap-allocate lisp memory to signal (as if by CERROR)
an ALLOCATION-DISABLED condition. (Allocaton is enabled globally at
the point where the error is signaled.) Continuing from the CERROR
restarts the allocation attempt.

This is intended to help verify that code that's not expected to
cons doesn't do so.

(This is only implemented on the ARM at the moment, but the intent
is that it be supported on all platforms.)

Note that calling (ALLOW-HEAP-ALLOCATION NIL) in the REPL CERRORs
immediately, since the REPL will cons to create the new value of CL:/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/arm-error-signal.lisp

    r14119 r14807  
    285285               :format-arguments (list (if (eql arg arm::vsp) "value" "control")))
    286286              nil frame-ptr))
     287            ((eql error-number arch::error-allocation-disabled)
     288             (restart-case (%error 'allocation-disabled nil frame-ptr)
     289               (continue ()
     290                         :report (lambda (stream)
     291                                   (format stream "retry the heap allocation.")))))
    287292            (t
    288293             (error "%errdisp callback: error-number = ~d, arg = #x~x, fnreg = ~d, rpc = ~d"
Note: See TracChangeset for help on using the changeset viewer.